:root {
  --jobapp-green: #2a8d4f;
  --jobapp-green-dark: #1f6b3b;
  --jobapp-green-fill: #eaf6ef;
  --jobapp-green-fill-strong: #d6efde;
  --jobapp-muted: #6c757d;
  --jobapp-danger: #dc3545;
  --jobapp-danger-fill: #fdf2f3;
  --jobapp-warning-fill: #fff8e1;
  --jobapp-warning-border: #ffe082;
}

.application-job-summary {
  padding: .875rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
}

.application-job-summary .job-title {
  margin: 0 0 .125rem;
  font-weight: 600;
  font-size: 1.0625rem;
  color: #212529;
  line-height: 1.3;
}

.application-job-summary .job-meta {
  display: flex;
  align-items: center;
  gap: .375rem;
  margin: 0;
  color: var(--jobapp-muted);
  font-size: .875rem;
  line-height: 1.4;
}

.application-job-summary .job-meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.application-progress {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.25rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.application-progress .progress-step {
  display: flex;
  align-items: center;
  gap: .625rem;
  color: var(--jobapp-muted);
  font-weight: 500;
  font-size: .875rem;
  white-space: nowrap;
  transition: color .25s ease;
}

.application-progress .progress-step .step-circle {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e9ecef;
  color: var(--jobapp-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8125rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.application-progress .progress-step.is-active {
  color: var(--jobapp-green);
  font-weight: 600;
}

.application-progress .progress-step.is-active .step-circle {
  background: var(--jobapp-green);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(42, 141, 79, .18);
  transform: scale(1.04);
}

.application-progress .progress-step.is-done {
  color: var(--jobapp-green-dark);
}

.application-progress .progress-step.is-done .step-circle {
  background: var(--jobapp-green);
  color: transparent;
}

.application-progress .progress-step.is-done .step-circle::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.application-progress .progress-divider {
  flex: 1 1 auto;
  height: 3px;
  background: #e9ecef;
  margin: 0 .25rem;
  min-width: 24px;
  border-radius: 999px;
  transition: background-color .35s ease;
}

.application-progress .progress-step.is-done + .progress-divider {
  background: var(--jobapp-green);
}

.application-step {
  display: none;
}

.application-step.is-active {
  display: block;
  animation: appStepIn .25s ease both;
}

@keyframes appStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.jobapp-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 2rem 1.5rem;
  border: 2px dashed var(--jobapp-green);
  border-radius: 12px;
  background: var(--jobapp-green-fill);
  color: #2f4f3a;
  text-align: center;
  cursor: pointer;
  outline: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.jobapp-dropzone:hover,
.jobapp-dropzone:focus-visible {
  background: var(--jobapp-green-fill-strong);
}

.jobapp-dropzone.is-dragover {
  border-style: solid;
  background: var(--jobapp-green-fill-strong);
}

.jobapp-dropzone.is-uploading {
  cursor: progress;
}

.jobapp-dropzone.is-error {
  border-color: var(--jobapp-danger);
  background: var(--jobapp-danger-fill);
  color: #5a1e25;
}

.jobapp-dropzone .jobapp-hidden-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: inherit;
}

.jobapp-dropzone .dz-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  pointer-events: none;
}

.jobapp-dropzone .dz-panel-idle { display: flex; }

.jobapp-dropzone.is-uploading .dz-panel-idle,
.jobapp-dropzone.is-error .dz-panel-idle { display: none; }

.jobapp-dropzone.is-uploading .dz-panel-uploading { display: flex; }
.jobapp-dropzone.is-error .dz-panel-error { display: flex; }

.jobapp-dropzone .icon-large {
  width: 56px;
  height: 56px;
  stroke-width: 1.5;
}

.jobapp-dropzone .title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: .25rem 0 0;
}

.jobapp-dropzone .subtitle {
  color: var(--jobapp-muted);
  font-size: .875rem;
  margin: 0;
}

.jobapp-dropzone.is-error .subtitle {
  color: #6b1d27;
}

.jobapp-dropzone .retry {
  pointer-events: auto;
  margin-top: .5rem;
  text-decoration: underline;
  color: var(--jobapp-danger);
  cursor: pointer;
  background: none;
  border: 0;
  font-weight: 500;
  padding: 0;
}

.dz-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(42,141,79,.2);
  border-top-color: var(--jobapp-green);
  border-radius: 50%;
  animation: dzSpin .8s linear infinite;
}

@keyframes dzSpin {
  to { transform: rotate(360deg); }
}

.jobapp-cv-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 100%;
  padding: .375rem .875rem;
  border-radius: 999px;
  background: var(--jobapp-green-fill);
  color: #1f4a2c;
  font-size: .875rem;
  margin-bottom: 1rem;
}

.jobapp-cv-chip .filename {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}

.jobapp-cv-chip .filesize {
  color: var(--jobapp-muted);
  font-weight: 400;
}

.jobapp-cv-chip .change-cv {
  margin-left: .25rem;
  background: none;
  border: 0;
  padding: 0;
  color: var(--jobapp-green-dark);
  text-decoration: underline;
  font-weight: 500;
  cursor: pointer;
}

.jobapp-cv-chip .change-cv:hover {
  color: #143d24;
}

.jobapp-cv-chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.jobapp-parse-warning {
  display: none;
  background: var(--jobapp-warning-fill);
  border: 1px solid var(--jobapp-warning-border);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .875rem;
  color: #6b4f00;
}

.jobapp-parse-warning.is-visible {
  display: block;
}

#jobapp_form .form-group.has-error .form-control,
#jobapp_form .form-control.is-invalid {
  border-color: var(--jobapp-danger);
  box-shadow: 0 0 0 .15rem rgba(220, 53, 69, .12);
}

#jobapp_form .form-group.has-error .help-block,
#jobapp_form .invalid-feedback {
  color: var(--jobapp-danger);
  font-size: .8125rem;
  margin-top: .25rem;
}

#jobapp_form .form-group.has-success .form-control {
  border-color: rgba(42, 141, 79, .55);
}

#jobapp_form .form-control-feedback {
  display: none !important;
}

@media (max-width: 575.98px) {
  .application-job-summary { padding: .625rem .75rem; }
  .application-job-summary .job-title { font-size: 1rem; }
  .application-job-summary .job-meta { font-size: .8125rem; }
  .application-progress { padding: .625rem .75rem; gap: .375rem; }
  .application-progress .progress-step .step-circle { width: 28px; height: 28px; font-size: .75rem; }
  .application-progress .progress-step.is-active .step-circle { box-shadow: 0 0 0 3px rgba(42, 141, 79, .18); }
  .application-progress .progress-step.is-done .step-circle::after { width: 6px; height: 10px; }
  .application-progress .progress-step span:last-child { display: none; }
  .application-progress .progress-step.is-active span:last-child { display: inline; }
  .jobapp-dropzone { min-height: 220px; padding: 1.5rem 1rem; }
  .jobapp-dropzone .icon-large { width: 44px; height: 44px; }
  .jobapp-cv-chip .filename { max-width: 9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .application-progress .progress-step,
  .application-progress .progress-step .step-circle,
  .application-progress .progress-divider {
    transition: none;
  }
  .application-progress .progress-step.is-active .step-circle {
    transform: none;
  }
}
