/* =========================================================
   PPGL CANDIDATE PORTAL
   Candidate Application + Candidate Privacy Policy
   Requires ../css/style.css to load first.
========================================================= */

/* -------------------------
   PAGE FOUNDATION
------------------------- */

.candidate-portal-body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 210, 0, 0.1), transparent 24%),
    radial-gradient(
      circle at 92% 8%,
      rgba(30, 115, 190, 0.14),
      transparent 28%
    ),
    var(--navy-950);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.candidate-portal-body *,
.candidate-portal-body *::before,
.candidate-portal-body *::after {
  box-sizing: border-box;
}

.candidate-portal-body a {
  color: inherit;
  text-decoration: none;
}

.candidate-portal-body button,
.candidate-portal-body input,
.candidate-portal-body select,
.candidate-portal-body textarea {
  font: inherit;
}

.candidate-portal-body .container {
  width: min(calc(100% - 32px), var(--max, 1240px));
  margin-inline: auto;
}

/* -------------------------
   PORTAL HEADER
------------------------- */

.candidate-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--navy-900) 86%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.candidate-nav {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}

.candidate-logo {
  display: inline-flex;
  align-items: center;
}

.candidate-logo img {
  display: block;
  width: auto;
  height: 48px;
}

.candidate-nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.candidate-nav-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.candidate-nav-links a:hover,
.candidate-nav-links a:focus-visible {
  background: var(--panel);
  color: var(--text);
}

.candidate-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: var(--panel-strong);
}

.theme-toggle-icon {
  color: var(--gold-500);
  font-size: 1rem;
}

.portal-exit {
  min-height: 42px;
  padding: 10px 16px;
  font-size: 0.78rem;
}

/* -------------------------
   PAGE SHELL + HERO
------------------------- */

.application-page {
  min-height: calc(100vh - 76px);
  padding: 48px 0 72px;
}

.application-shell {
  overflow: clip;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--navy-900);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.application-title-bar {
  position: relative;
  overflow: hidden;
  padding: 48px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(5, 11, 18, 0.94), rgba(11, 36, 60, 0.92)),
    radial-gradient(
      circle at 12% 18%,
      rgba(255, 210, 0, 0.22),
      transparent 30%
    ),
    radial-gradient(
      circle at 90% 10%,
      rgba(30, 115, 190, 0.38),
      transparent 34%
    ),
    var(--navy-850);
}

.application-title-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

.portal-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 48px;
  align-items: end;
}

.application-title-bar span:first-child {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--gold-500);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.application-title-bar h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.8rem, 4.9vw, 4.85rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.application-title-bar p {
  max-width: 780px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.96rem, 1.2vw, 1.08rem);
  font-weight: 400;
  line-height: 1.75;
}

.portal-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.portal-hero-meta div {
  min-width: 140px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.075);
}

.portal-hero-meta strong,
.portal-hero-meta small {
  display: block;
}

.portal-hero-meta strong {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 900;
}

.portal-hero-meta small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.68rem;
  line-height: 1.4;
}

.portal-readiness-card {
  align-self: stretch;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
}

.portal-readiness-card .status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 8px rgba(255, 210, 0, 0.12);
}

.portal-readiness-card strong {
  display: block;
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
}

.portal-readiness-card p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.82rem;
  line-height: 1.65;
}

.portal-readiness-card a {
  display: inline-flex;
  margin-top: 20px;
  color: var(--gold-500);
  font-size: 0.78rem;
  font-weight: 700;
}

/* -------------------------
   STAGE OVERVIEW
------------------------- */

.candidate-intake-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 24px 24px 0;
}

.intake-step-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.intake-step-card span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--gold-500);
  font-size: 0.72rem;
  font-weight: 900;
}

.intake-step-card strong,
.intake-step-card small {
  display: block;
}

.intake-step-card strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.intake-step-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

/* -------------------------
   PRIVACY / SECURITY NOTICE
------------------------- */

.data-security-notice {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  margin: 24px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--gold-500) 34%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--gold-500) 8%, var(--panel));
}

.notice-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-500);
  color: var(--slate-900);
  font-size: 0.9rem;
  font-weight: 900;
}

.data-security-notice h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.data-security-notice p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.data-security-notice a {
  color: var(--blue-500);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.application-alert {
  display: none;
  margin: 0 24px 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.5;
}

.application-alert.success,
.application-alert.error,
.application-alert.info {
  display: block;
}

.application-alert.success {
  border-left: 4px solid rgb(22 163 74);
}

.application-alert.error {
  border-left: 4px solid rgb(220 38 38);
}

.application-alert.info {
  border-left: 4px solid var(--blue-500);
}

/* -------------------------
   DESKTOP WIZARD WORKSPACE
------------------------- */

.candidate-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  padding: 0 24px 24px;
}

.candidate-wizard-panel {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.candidate-wizard-topline {
  display: block;
}

.candidate-wizard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-500);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.candidate-wizard-kicker::before {
  content: "";
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--gold-500);
}

.candidate-wizard-title {
  margin: 12px 0 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.candidate-wizard-subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.candidate-wizard-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--navy-800);
  color: var(--white);
}

.candidate-wizard-score span {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.candidate-wizard-score strong {
  font-size: 1.25rem;
  font-weight: 900;
}

.candidate-wizard-progress-track {
  height: 8px;
  margin: 16px 0 20px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-strong);
}

.candidate-wizard-progress-fill {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-500), var(--blue-500));
  transition: width 0.28s ease;
}

.candidate-wizard-nav {
  display: grid;
  gap: 8px;
}

.candidate-wizard-step-btn {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.candidate-wizard-step-btn:hover {
  background: var(--panel-strong);
  color: var(--text);
}

.candidate-wizard-step-btn.active {
  border-color: color-mix(in srgb, var(--blue-500) 40%, var(--border));
  background: color-mix(in srgb, var(--blue-500) 12%, var(--panel));
  color: var(--text);
}

.candidate-wizard-step-btn.completed {
  color: var(--text);
}

.candidate-wizard-step-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.candidate-wizard-step-btn.active .candidate-wizard-step-number {
  background: var(--gold-500);
  color: var(--slate-900);
}

.candidate-wizard-step-btn.completed .candidate-wizard-step-number {
  background: var(--blue-500);
  color: var(--white);
}

.candidate-wizard-step-text strong,
.candidate-wizard-step-text span {
  display: block;
}

.candidate-wizard-step-text strong {
  color: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.candidate-wizard-step-text span {
  margin-top: 5px;
  font-size: 0.66rem;
  line-height: 1.4;
}

/* -------------------------
   FORM FOUNDATION
------------------------- */

.application-form {
  min-width: 0;
  padding: 0;
}

.application-form.wizard-enabled .form-section-block {
  display: none;
  animation: ppglStepFade 0.24s ease both;
}

.application-form.wizard-enabled .form-section-block.wizard-step-active {
  display: block;
}

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

.form-section-block {
  position: relative;
  margin-bottom: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.form-section-block:last-of-type {
  margin-bottom: 0;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue-500) 12%, var(--panel));
  color: var(--blue-500);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.section-heading-row h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.section-heading-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.form-grid-2,
.form-grid-3 {
  display: grid;
  gap: 20px;
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--navy-900);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.4;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.6;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: color-mix(in srgb, var(--blue-500) 50%, var(--border));
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(30, 115, 190, 0.14);
  background: var(--navy-850);
}

.field input[readonly] {
  background: var(--panel);
  color: var(--muted);
  cursor: not-allowed;
}

.field input::placeholder,
.field textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.field small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.required {
  color: var(--gold-500);
  font-weight: 900;
}

.hidden-field,
.conditional-field {
  display: none !important;
}

.conditional-field.active {
  display: flex !important;
}

.field-error-highlight {
  border-color: rgb(220 38 38) !important;
  box-shadow: 0 0 0 4px rgb(220 38 38 / 0.14) !important;
}

/* -------------------------
   CHECKBOX GROUPS
------------------------- */

.mini-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.mini-check,
.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
  cursor: pointer;
}

.mini-check:hover,
.checkbox-line:hover {
  border-color: color-mix(in srgb, var(--blue-500) 48%, var(--border));
}

.mini-check input,
.checkbox-line input,
.declaration-panel input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--blue-500);
}

/* -------------------------
   DYNAMIC RECORDS
------------------------- */

.dynamic-section {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.dynamic-row,
.employment-history-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--navy-900);
}

.dynamic-row .full,
.employment-history-card .full {
  grid-column: 1 / -1;
}

.dynamic-row .remove-row-btn,
.employment-history-card .remove-row-btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.add-row-btn,
.remove-row-btn,
.submit-btn,
.wizard-btn,
#agreePrivacyBtn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.add-row-btn:hover,
.remove-row-btn:hover,
.submit-btn:hover,
.wizard-btn:hover,
#agreePrivacyBtn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.add-row-btn,
.wizard-btn.primary {
  background: var(--blue-500);
  color: var(--white);
}

.remove-row-btn {
  border-color: color-mix(in srgb, rgb(220 38 38) 32%, var(--border));
  background: color-mix(in srgb, rgb(220 38 38) 10%, var(--panel));
  color: rgb(220 38 38);
}

/* -------------------------
   GUIDANCE + SPECIAL MODULES
------------------------- */

.role-certification-prompt,
.declaration-box,
.application-review-panel,
.policy-contact-box {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--navy-900);
}

.role-certification-prompt h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.role-certification-prompt p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.role-guidance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.role-guidance-grid div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.role-guidance-grid span,
.role-guidance-grid strong {
  display: block;
}

.role-guidance-grid span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-guidance-grid strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
}

.required-cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.required-cert-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--blue-500) 40%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue-500) 10%, var(--panel));
  color: var(--blue-500);
  font-size: 0.64rem;
  font-weight: 700;
}

.photo-preview-box {
  min-height: 160px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--blue-500) 45%, var(--border));
  border-radius: var(--radius-md);
  background: var(--navy-900);
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.photo-preview-box img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.employment-required-note,
.optional-education-note,
.driver-license-required-note {
  display: none;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--gold-500) 36%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--gold-500) 8%, var(--panel));
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.employment-required-note.active {
  display: block;
}

.application-review-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.review-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.review-card strong,
.review-card span {
  display: block;
}

.review-card strong {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.review-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.declaration-box {
  display: grid;
  gap: 12px;
}

.declaration-box .checkbox-line {
  margin: 0;
}

/* -------------------------
   WIZARD ACTIONS + SUBMIT
------------------------- */

.wizard-navigation-actions {
  position: sticky;
  bottom: 16px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--navy-900) 92%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.wizard-btn.secondary {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.wizard-btn:disabled,
.submit-btn:disabled,
#agreePrivacyBtn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.submit-area {
  display: flex;
  justify-content: flex-end;
}

.submit-btn,
#agreePrivacyBtn {
  min-height: 50px;
  padding-inline: 24px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  color: var(--slate-900);
  box-shadow: 0 20px 42px rgba(255, 210, 0, 0.22);
}

.form-locked input,
.form-locked select,
.form-locked textarea,
.form-locked button {
  opacity: 0.56;
  cursor: not-allowed;
}

.form-locked::before {
  content: "Privacy consent is required before the application can be completed.";
  display: block;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--gold-500) 36%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--gold-500) 8%, var(--panel));
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
}

/* -------------------------
   PRIVACY MODAL
------------------------- */

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 11, 18, 0.82);
  backdrop-filter: blur(12px);
}

.privacy-modal.hidden {
  display: none;
}

.privacy-modal-box {
  width: min(100%, 520px);
  padding: 32px;
  border: 1px solid color-mix(in srgb, var(--gold-500) 38%, var(--border));
  border-top: 5px solid var(--gold-500);
  border-radius: var(--radius-lg);
  background: var(--navy-900);
  box-shadow: var(--shadow);
}

.privacy-modal-box h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.1;
}

.privacy-modal-box p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.privacy-modal-box a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--blue-500);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 900;
}

.privacy-modal-note {
  font-size: 0.7rem !important;
}

/* -------------------------
   PRIVACY POLICY DOCUMENT
------------------------- */

.privacy-shell {
  overflow: clip;
  border-radius: var(--radius-xl);
}

.privacy-hero {
  overflow: hidden;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.policy-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.policy-meta-row span {
  margin: 0 !important;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.policy-meta-row strong {
  color: var(--white);
}

.privacy-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 24px;
}

.privacy-summary article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.privacy-summary article > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--gold-500);
  font-size: 0.72rem;
  font-weight: 900;
}

.privacy-summary strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.privacy-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.privacy-document-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  padding: 0 24px 24px;
}

.privacy-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.privacy-toc > span {
  margin-bottom: 8px;
  color: var(--gold-500);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.privacy-toc a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.privacy-toc a:hover,
.privacy-toc a:focus-visible {
  background: var(--panel-strong);
  color: var(--text);
}

.privacy-policy-content {
  display: grid;
  gap: 16px;
}

.privacy-policy-content .form-section-block {
  margin: 0;
  scroll-margin-top: 110px;
}

.privacy-policy-content .section-heading-row {
  grid-template-columns: 1fr;
  margin-bottom: 16px;
}

.privacy-policy-content .form-section-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.8;
}

.privacy-policy-content .form-section-block p + p {
  margin-top: 14px;
}

.policy-contact-box {
  display: grid;
  gap: 8px;
}

.policy-contact-box strong {
  color: var(--text);
  font-size: 0.78rem;
}

.policy-contact-box a {
  color: var(--blue-500);
  font-size: 0.78rem;
  font-weight: 700;
}

.policy-contact-box span {
  color: var(--muted);
  font-size: 0.74rem;
}

.consent-gateway {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gold-500) 34%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.consent-heading {
  padding: 28px;
  background: var(--navy-850);
}

.consent-heading > span {
  color: var(--gold-500);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.consent-heading h2 {
  margin: 10px 0 0;
  color: var(--text);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.consent-heading p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.declaration-panel {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.declaration-panel label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--navy-900);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.declaration-panel label:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue-500) 48%, var(--border));
}

.declaration-panel label:has(input:checked) {
  border-color: color-mix(in srgb, var(--blue-500) 52%, var(--border));
  background: color-mix(in srgb, var(--blue-500) 10%, var(--panel));
}

.declaration-panel label span,
.declaration-panel label strong {
  display: block;
}

.declaration-panel label span {
  font-size: 0.78rem;
  line-height: 1.65;
}

.declaration-panel label strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.submit-panel {
  padding: 24px;
  border-top: 1px solid var(--border);
  background: var(--navy-850);
  text-align: center;
}

.submit-panel p {
  max-width: 640px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.fraud-warning-card {
  border-color: rgba(255, 210, 0, 0.28);
}

/* -------------------------
   FOOTER
------------------------- */

.candidate-footer {
  padding-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(
      circle at 12% 20%,
      rgba(30, 115, 190, 0.16),
      transparent 28%
    ),
    radial-gradient(
      circle at 88% 70%,
      rgba(255, 210, 0, 0.08),
      transparent 24%
    ),
    linear-gradient(135deg, #03070c, #07111d 48%, #081827);
  color: rgba(255, 255, 255, 0.72);
}

.candidate-footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
}

.candidate-footer img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  margin-bottom: 16px;
}

.candidate-footer h3 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: 0.86rem;
  font-weight: 700;
}

.candidate-footer p,
.candidate-footer a,
.candidate-footer span {
  display: block;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.76rem;
  line-height: 1.6;
}

.candidate-footer a:hover {
  color: var(--gold-500);
}

.candidate-footer-bottom {
  padding: 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  text-align: center;
}

/* -------------------------
   LIGHT THEME REFINEMENTS
------------------------- */

html[data-theme="light"] .candidate-header {
  background: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .application-title-bar {
  color: var(--white);
}

html[data-theme="light"] .candidate-wizard-panel,
html[data-theme="light"] .form-section-block,
html[data-theme="light"] .intake-step-card,
html[data-theme="light"] .privacy-toc,
html[data-theme="light"] .privacy-summary article,
html[data-theme="light"] .consent-gateway {
  background: var(--navy-900);
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .dynamic-row,
html[data-theme="light"] .employment-history-card,
html[data-theme="light"] .role-certification-prompt,
html[data-theme="light"] .declaration-box,
html[data-theme="light"] .application-review-panel,
html[data-theme="light"] .declaration-panel label {
  background: var(--slate-50);
}

/* -------------------------
   RESPONSIVE
------------------------- */

@media (max-width: 1100px) {
  .candidate-nav {
    grid-template-columns: auto 1fr;
  }

  .candidate-nav-links {
    justify-content: flex-end;
  }

  .candidate-nav-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-bottom: 12px;
  }

  .candidate-intake-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .candidate-workspace,
  .privacy-document-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .form-grid-3,
  .mini-check-grid,
  .dynamic-row,
  .employment-history-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-guidance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .application-page {
    padding-top: 32px;
  }

  .application-title-bar {
    padding: 40px 32px;
  }

  .portal-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .candidate-intake-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate-workspace,
  .privacy-document-layout {
    grid-template-columns: 1fr;
  }

  .candidate-wizard-panel,
  .privacy-toc {
    position: static;
  }

  .candidate-wizard-nav {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .candidate-wizard-step-btn {
    min-width: 150px;
  }

  .privacy-toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .privacy-toc > span {
    grid-column: 1 / -1;
  }

  .section-heading-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .candidate-portal-body .container {
    width: min(calc(100% - 24px), var(--max, 1240px));
  }

  .candidate-nav {
    min-height: auto;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 12px 0;
  }

  .candidate-nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .candidate-nav-actions {
    grid-column: auto;
    padding: 0;
  }

  .portal-exit {
    display: none;
  }

  .theme-toggle-label {
    display: none;
  }

  .theme-toggle {
    width: 42px;
    padding: 0;
  }

  .application-title-bar {
    padding: 32px 24px;
  }

  .application-title-bar h1 {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
  }

  .portal-hero-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-hero-meta div {
    min-width: 0;
  }

  .candidate-intake-overview,
  .privacy-summary {
    grid-template-columns: 1fr;
    padding: 16px 16px 0;
  }

  .data-security-notice {
    grid-template-columns: 1fr;
    margin: 16px;
  }

  .candidate-workspace,
  .privacy-document-layout {
    padding: 0 16px 16px;
  }

  .candidate-wizard-panel,
  .form-section-block,
  .consent-heading,
  .declaration-panel,
  .submit-panel {
    padding: 20px;
  }

  .form-grid-2,
  .form-grid-3,
  .mini-check-grid,
  .dynamic-row,
  .employment-history-card,
  .role-guidance-grid,
  .application-review-panel,
  .privacy-summary,
  .candidate-footer-grid {
    grid-template-columns: 1fr;
  }

  .wizard-navigation-actions {
    bottom: 8px;
  }

  .wizard-action-left,
  .wizard-action-right,
  .wizard-btn {
    width: 100%;
  }

  .wizard-navigation-actions {
    align-items: stretch;
  }

  .privacy-toc {
    grid-template-columns: 1fr;
  }

  .candidate-footer-grid {
    gap: 28px;
  }
}

@media (max-width: 520px) {
  .candidate-logo img {
    height: 42px;
  }

  .application-shell {
    border-radius: var(--radius-lg);
  }

  .candidate-wizard-nav {
    grid-template-columns: repeat(5, 138px);
  }

  .candidate-wizard-step-btn {
    min-width: 138px;
  }

  .wizard-navigation-actions {
    flex-direction: column-reverse;
  }

  .submit-area,
  .submit-btn,
  #agreePrivacyBtn {
    width: 100%;
  }

  .privacy-modal-box {
    padding: 24px;
  }
}

/* =========================================================
   TEAM 9 — CANDIDATE APPLICATION V2.0 PRODUCTION REBUILD
   Final structural, validation, review and theme integration.
========================================================= */

/* Canonical theme selector from style.css owns the component. */
.candidate-nav-actions .theme-menu {
  flex: 0 0 auto;
}

.candidate-nav-actions .theme-toggle {
  width: auto;
}

/* Workspace ownership: sidebar and form content are separate columns. */
.candidate-workspace {
  align-items: start;
}

.candidate-main-column {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.candidate-main-column > .application-alert,
.candidate-main-column > .validation-summary {
  margin: 0;
}

.candidate-main-column > .application-form {
  min-width: 0;
  grid-column: 1;
}

/* Identity document is a synchronized upload interface, not a second data source. */
.identity-document-card {
  display: grid;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--navy-900);
}

.identity-document-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.identity-document-summary > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.identity-document-summary span,
.identity-document-summary strong {
  display: block;
}

.identity-document-summary span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.identity-document-summary strong {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.identity-edit-btn {
  width: fit-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  transition: 0.2s ease;
}

.identity-edit-btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue-500) 46%, var(--border));
  background: var(--panel-strong);
}

.identity-upload-field {
  padding: 18px;
  border: 1px dashed color-mix(in srgb, var(--blue-500) 46%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--blue-500) 6%, var(--panel));
}

.file-selection-status {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Production validation recovery. */
.validation-summary {
  padding: 22px;
  border: 1px solid color-mix(in srgb, rgb(220 38 38) 42%, var(--border));
  border-left: 5px solid rgb(220 38 38);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, rgb(220 38 38) 7%, var(--navy-900));
  box-shadow: var(--shadow-soft);
}

.validation-summary[hidden] {
  display: none;
}

.validation-summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.validation-summary-heading span {
  display: block;
  color: rgb(220 38 38);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.validation-summary-heading h2 {
  margin-top: 6px;
  color: var(--text);
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-weight: 900;
  line-height: 1.1;
}

.validation-summary-heading > strong {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgb(220 38 38);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
}

.validation-summary-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.validation-summary-group {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--navy-900);
}

.validation-summary-group h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.validation-summary-group ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.validation-summary-group button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: left;
}

.validation-summary-group button:hover,
.validation-summary-group button:focus-visible {
  background: var(--panel-strong);
  color: var(--text);
}

.validation-field-error {
  border-color: rgb(220 38 38) !important;
  background: color-mix(in srgb, rgb(220 38 38) 5%, var(--navy-900)) !important;
  box-shadow: 0 0 0 4px rgb(220 38 38 / 0.13) !important;
}

/* Final review is an actionable quality checkpoint. */
.application-review-panel {
  display: block;
  margin: 0 0 24px;
}

.review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.review-heading > div > span {
  display: block;
  color: var(--gold-ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-heading h3 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  font-weight: 900;
  line-height: 1.1;
}

.review-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.review-heading > strong {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, rgb(220 38 38) 34%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, rgb(220 38 38) 9%, var(--panel));
  color: rgb(220 38 38);
  font-size: 0.7rem;
  font-weight: 900;
}

.review-heading > strong.ready {
  border-color: color-mix(in srgb, rgb(22 163 74) 38%, var(--border));
  background: color-mix(in srgb, rgb(22 163 74) 9%, var(--panel));
  color: rgb(22 163 74);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.review-card button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--blue-500);
  font-size: 0.68rem;
  font-weight: 700;
}

/* Submitted applications leave the form and display an unambiguous final state. */
.application-success-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  padding: 40px;
  border: 1px solid color-mix(in srgb, rgb(22 163 74) 38%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, rgb(22 163 74) 7%, var(--navy-900));
  box-shadow: var(--shadow-soft);
}

.success-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(22 163 74);
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
}

.application-success-panel > div > span {
  color: rgb(22 163 74);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.application-success-panel h2 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
}

.application-success-panel p {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.application-success-panel strong {
  display: block;
  margin-top: 14px;
  color: var(--text);
}

.application-success-panel .btn {
  margin-top: 24px;
}

/* File controls remain native but are visibly usable in both themes. */
.field input[type="file"] {
  padding: 8px;
}

.field input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: 12px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--blue-500);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

html[data-theme="light"] .identity-document-card,
html[data-theme="light"] .validation-summary-group {
  background: var(--slate-50);
}

@media (max-width: 900px) {
  .candidate-main-column {
    grid-column: 1;
  }

  .validation-summary-groups,
  .identity-document-summary,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .candidate-nav-actions .theme-menu {
    width: auto;
  }

  .candidate-nav-actions .theme-dropdown {
    position: absolute;
    right: 0;
    width: min(310px, calc(100vw - 32px));
  }
}

@media (max-width: 720px) {
  .candidate-nav-actions .theme-toggle-label,
  .candidate-nav-actions .theme-toggle-chevron {
    display: none;
  }

  .candidate-nav-actions .theme-toggle {
    width: 42px;
    padding: 0;
  }

  .validation-summary-heading,
  .review-heading {
    flex-direction: column;
  }

  .review-card {
    grid-template-columns: 1fr;
  }

  .review-card button {
    width: fit-content;
  }

  .application-success-panel {
    grid-template-columns: 1fr;
    padding: 28px 22px;
  }
}
/* =========================================================
   CANDIDATE PORTAL THEME MENU — HEADER OVERRIDE
   Prevent the global mobile theme rules from breaking the
   Candidate Portal header between 901px and 1120px.
========================================================= */

@media (max-width: 1120px) {
  .candidate-nav-actions .theme-menu {
    position: relative;
    width: auto;
    flex: 0 0 auto;
  }

  .candidate-nav-actions .theme-toggle {
    width: auto;
    justify-content: center;
    padding: 8px 14px;
    text-align: center;
  }

  .candidate-nav-actions .theme-toggle-chevron {
    margin-left: 0;
  }

  .candidate-nav-actions .theme-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 2100;
    display: block;
    width: min(310px, calc(100vw - 32px));
    margin-top: 0;
    padding: 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(0.96);
  }

  .candidate-nav-actions .theme-menu.is-open .theme-dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .candidate-nav-actions .theme-dropdown::before {
    display: block;
  }
}

/* =========================================================
   TEAM 9 — MULTIPLE IDENTIFICATION, CORRECTION NAVIGATION,
   AND RELIABLE NATIVE THEME SELECTOR
========================================================= */

.candidate-theme-selector {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}

.candidate-theme-selector select {
  min-height: 40px;
  padding: 0 28px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.candidate-theme-selector select:focus-visible {
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(30, 115, 190, 0.14);
}

.identification-card-heading,
.additional-identification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.identification-card-heading h3,
.additional-identification-heading h3 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.additional-identification-heading {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.additional-identification-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.identification-record-label {
  color: var(--blue-500);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.additional-identification-row {
  position: relative;
}

.review-heading > .review-readiness-control {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, rgb(220 38 38) 34%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, rgb(220 38 38) 9%, var(--panel));
  color: rgb(220 38 38);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 900;
}

.review-heading > .review-readiness-control:hover,
.review-heading > .review-readiness-control:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgb(220 38 38 / 0.12);
}

.review-heading > .review-readiness-control.ready {
  border-color: color-mix(in srgb, rgb(22 163 74) 38%, var(--border));
  background: color-mix(in srgb, rgb(22 163 74) 9%, var(--panel));
  color: rgb(22 163 74);
  cursor: default;
}

@media (max-width: 720px) {
  .candidate-theme-selector {
    padding-inline: 10px;
  }

  .candidate-theme-selector select {
    max-width: 82px;
  }

  .identification-card-heading,
  .additional-identification-heading {
    flex-direction: column;
  }
}

/* -------------------------
   INTERNATIONAL PHONE FIELDS
------------------------- */

/*
 * Shared by every telephone control in the application:
 * candidate phone, WhatsApp, emergency contact, and employment references.
 *
 * The compact country-code selector displays the country flag and calling
 * code, while the local-number input receives the majority of the available
 * width. No fixed minimum width may force either control outside its form
 * column.
 */

.international-phone-field {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(105px, 0.55fr) minmax(0, 1.45fr);
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
}

.international-phone-field .phone-country-code,
.international-phone-field .phone-local-number {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.international-phone-field .phone-country-code {
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.international-phone-field .phone-local-number {
  letter-spacing: 0.01em;
}

.international-phone-field .phone-local-number:invalid:not(:placeholder-shown) {
  border-color: rgb(220 38 38);
}

.phone-format-help {
  display: block;
  width: 100%;
  min-height: 1.1em;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

/*
 * At tablet widths, give slightly more space to the number while keeping
 * both controls on one line.
 */
@media (max-width: 1100px) {
  .international-phone-field {
    grid-template-columns: minmax(100px, 0.5fr) minmax(0, 1.5fr);
    gap: 10px;
  }
}

/*
 * Once an individual form column becomes narrow, stack the controls.
 * This applies consistently to all current and dynamically added phone fields.
 */
@media (max-width: 760px) {
  .international-phone-field {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   MOBILE VIEWPORT CONTAINMENT
========================================================= */

@media (max-width: 720px) {
  .candidate-portal-body .application-page,
  .candidate-portal-body .application-page > .container,
  .candidate-portal-body .application-shell,
  .candidate-portal-body .candidate-workspace,
  .candidate-portal-body .candidate-wizard-panel,
  .candidate-portal-body .candidate-main-column,
  .candidate-portal-body .application-form,
  .candidate-portal-body .form-section-block,
  .candidate-portal-body .wizard-navigation-actions {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .candidate-portal-body .application-shell,
  .candidate-portal-body .candidate-workspace,
  .candidate-portal-body .candidate-wizard-panel,
  .candidate-portal-body .candidate-main-column,
  .candidate-portal-body .application-form {
    width: 100%;
  }

  .candidate-portal-body .candidate-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  /*
   * Keep the five-stage navigator scrollable inside its own
   * container without expanding the application workspace.
   */
  .candidate-portal-body .candidate-wizard-nav {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .candidate-portal-body .field,
  .candidate-portal-body .field input,
  .candidate-portal-body .field select,
  .candidate-portal-body .field textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  /*
   * JavaScript generates anonymous div wrappers around the
   * Back and Continue buttons.
   */
  .candidate-portal-body .wizard-navigation-actions > div {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .candidate-portal-body .wizard-navigation-actions .wizard-btn {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* Compact two-row mobile header. */
  .candidate-nav {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .candidate-logo {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .candidate-nav-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .candidate-nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }

  .candidate-nav-links a {
    min-width: 0;
    padding: 7px 8px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }
}

@media (max-width: 520px) {
  .candidate-portal-body .form-section-block {
    padding: 18px 14px;
  }

  .candidate-portal-body .wizard-navigation-actions {
    padding: 12px;
  }
}
