/* Parent-page theme — FK Cēsis MMS. Components, typography, shared UI. */

:root {
  --fk-blue: #0f0851;
  --fk-red: #ce1c20;
  --fk-red-dark: #ab171b;
  --fk-bg: #f4f6fb;
  --fk-white: #ffffff;
  --fk-text: #1e2141;
  --fk-muted: #6f7694;
  --fk-border: #dfe4f1;
  --fk-soft-blue: #eef1ff;
  --fk-radius: 12px;
  --fk-radius-xl: 24px;
  --fk-radius-lg: 18px;
  --fk-radius-md: 12px;
  --fk-spacing: 16px;
  --fk-shadow: 0 12px 30px rgba(15, 8, 81, 0.08);
  --fk-shadow-soft: 0 8px 20px rgba(15, 8, 81, 0.06);
  --fk-maxw: 1180px;
  --fk-maxw-list: 1240px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(206, 28, 32, 0.06), transparent 25rem),
    linear-gradient(180deg, #fafbfe 0%, var(--fk-bg) 100%);
  color: var(--fk-text);
  margin: 0;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.02em;
  font-weight: 200;
  text-transform: uppercase;
}

.fk-parent-page {
  max-width: var(--fk-maxw);
  margin: 0 auto;
  padding: var(--fk-spacing);
}

/* ── Site header ── */

.fk-site-header {
  background: var(--fk-blue);
  color: var(--fk-white);
  border-bottom: 4px solid var(--fk-red);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 10px 24px rgba(15, 8, 81, 0.18);
}

.fk-header-inner {
  max-width: var(--fk-maxw-list);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.fk-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.fk-brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.25));
}

.fk-brand-text { min-width: 0; }

.fk-brand-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--fk-white);
  text-transform: uppercase;
  font-weight: 400;
}

.fk-brand-subtitle {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.97rem;
  font-weight: 500;
}

/* ── Eyebrow / lead ── */

.fk-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fk-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 16px;
}
.fk-back-link:hover { color: var(--fk-blue); }

.fk-eyebrow {
  color: var(--fk-red);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
}

.fk-lead {
  color: var(--fk-muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
  max-width: 720px;
}

/* ── Hero card (default: registration 2-col) ── */

.fk-hero-card {
  background: var(--fk-white);
  border: 1px solid var(--fk-border);
  box-shadow: var(--fk-shadow);
  border-radius: var(--fk-radius-xl);
  padding: 34px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  gap: 32px;
  overflow: hidden;
  position: relative;
}

.fk-hero-card::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: rgba(215, 25, 32, 0.08);
  pointer-events: none;
}

.fk-hero-card h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(38px, 5vw, 62px);
  margin: 0 0 12px;
  line-height: 1.03;
  color: var(--fk-blue);
  /* letter-spacing: -0.04em; */
}

/* ── Section card ── */

.fk-section-card {
  background: var(--fk-white);
  border: 1px solid var(--fk-border);
  box-shadow: var(--fk-shadow-soft);
  border-radius: var(--fk-radius-xl);
  overflow: visible;
  margin-bottom: 16px;
}

.fk-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 8px;
}

.fk-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.fk-section-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fk-soft-blue);
  color: var(--fk-blue);
  flex: 0 0 auto;
  font-size: 22px;
}

.fk-section-header h2 {
  margin: 0;
  color: var(--fk-blue);
  font-size: 26px;
}

.fk-section-note {
  margin: 6px 0 0;
  color: var(--fk-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

.fk-section-body {
  padding: 18px 32px 30px;
}

/* ── Form grid ── */

.fk-form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px 22px;
  align-items: start;
}

.fk-field { grid-column: span 6; }
.fk-field--third { grid-column: span 4; }
.fk-field--full { grid-column: 1 / -1; }

/* ── Form fields ── */

.fk-form-field {
  margin-bottom: 16px;
}

.fk-form-field--error .fk-form-label { color: var(--fk-red); }

.fk-form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #272759;
  margin-bottom: 7px;
}

.fk-form-field input[type="text"],
.fk-form-field input[type="email"],
.fk-form-field input[type="date"],
.fk-form-field input[type="number"],
.fk-form-field input[type="tel"],
.fk-form-field select,
.fk-form-field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--fk-border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--fk-text);
  background: var(--fk-white);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.fk-form-field input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--fk-blue);
}

.fk-form-field--checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.fk-form-label--checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  cursor: pointer;
  font-weight: 500;
}

.fk-form-field--checkbox input[type="checkbox"] {
  flex-shrink: 0;
  cursor: pointer;
}

.fk-form-field input:focus,
.fk-form-field select:focus,
.fk-form-field textarea:focus {
  border-color: var(--fk-blue);
  box-shadow: 0 0 0 4px rgba(15, 8, 81, 0.08);
}

.fk-form-field input.fk-input--error {
  border-color: var(--fk-red);
}

/* Guardian-profile locked visual state (Slice C). The always-readonly
   guardian email intentionally uses the same class for consistent appearance. */
.fk-form-field input.fk-input--guardian-locked {
  color: var(--fk-muted);
  background: #f4f6fb;
  border-color: #e0e4ef;
  cursor: not-allowed;
}

/* ── Date assist (Latvian DD.MM.GGGG field + native picker affordance) ── */
.fk-date-assist {
  position: relative;
  max-width: 280px;
  width: 100%;
}

.fk-date-assist input[data-date-format="lv-dot"] {
  width: 100%;
  padding-right: 52px;
}

.fk-date-assist__button {
  appearance: none;
  background: var(--fk-white);
  border: 1px solid var(--fk-border);
  border-radius: 8px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 46px;
}

/* Stronger selector than `.fk-form-field input[type="date"]` so the general
   form rule cannot leak width/min-height/border/padding onto the hidden
   native picker. Stays functional (clipped, not display:none) so
   `picker.showPicker()` still works. */
.fk-form-field .fk-date-assist__native[type="date"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.fk-form-help {
  color: var(--fk-muted);
  font-size: 13px;
  font-weight: 400;
  margin: 4px 0 0;
  line-height: 1.45;
}

.fk-form-error {
  color: var(--fk-red);
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 0;
}

/* ── Dropzone (file upload) ── */

.fk-dropzone {
  display: block;
  min-height: 142px;
  border: 2px dashed #b8bfd3;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  color: var(--fk-blue);
  background: linear-gradient(180deg, #fff 0%, #fafbff 100%);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  width: 100%;
}

.fk-dropzone:hover {
  border-color: var(--fk-blue);
  background: #f7f8ff;
  transform: translateY(-1px);
}

.fk-dropzone input[type="file"] { display: none; }
.fk-dropzone--filled { border-color: var(--fk-blue); border-style: solid; background: #f5f7ff; }

.fk-dropzone-icon { font-size: 28px; margin-bottom: 8px; }
.fk-dropzone-title { font-weight: 700; margin-bottom: 5px; }
.fk-dropzone-meta { color: var(--fk-muted); font-size: 13px; }
.fk-dropzone-preview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  object-fit: contain;
}

/* ── Info / requirements boxes ── */

.fk-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  margin-top: 18px;
  background: #eef4ff;
  color: #3a4670;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.fk-requirements {
  background: #f1f5ff;
  border-radius: 12px;
  padding: 18px;
  color: #303762;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

.fk-requirements strong { color: var(--fk-blue); font-weight: 700; }
.fk-requirements ul { margin: 8px 0 0; padding-left: 18px; }

/* ── Buttons ── */

.fk-button {
  appearance: none;
  border: 1px solid transparent;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.fk-button:hover { transform: translateY(-1px); }

/* BEM and legacy shorthand both supported */
.fk-button--primary,
.fk-button.primary {
  color: var(--fk-white);
  background: linear-gradient(135deg, var(--fk-blue), #1a0a7e);
  box-shadow: 0 12px 22px rgba(9, 6, 74, .20);
}

.fk-button--secondary,
.fk-button.secondary {
  color: var(--fk-blue);
  background: var(--fk-white);
  border-color: var(--fk-blue);
}

.fk-button--red {
  color: var(--fk-white);
  background: linear-gradient(135deg, var(--fk-red), var(--fk-red-dark));
  box-shadow: 0 10px 20px rgba(206, 28, 32, 0.18);
}

.fk-button--small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: 8px;
}

.fk-button--full {
  width: 100%;
  box-sizing: border-box;
}

.fk-button__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* ── Stepper ── */

.fk-stepper {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0;
  position: relative;
  z-index: 1;
}

.fk-step {
  text-align: center;
  color: var(--fk-muted);
  position: relative;
  min-width: 60px;
  cursor: pointer;
  user-select: none;
}

.fk-step:not(:first-child)::before {
  content: "";
  position: absolute;
  height: 2px;
  left: -50%;
  right: 50%;
  top: 22px;
  background: var(--fk-border);
  z-index: -1;
}

.fk-step-number {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef0f6;
  border: 1px solid var(--fk-border);
  color: var(--fk-muted);
  font-weight: 800;
  font-size: 15px;
}

.fk-step--active { color: var(--fk-red); }
.fk-step--active .fk-step-number {
  color: var(--fk-white);
  background: var(--fk-red);
  border-color: var(--fk-red);
  box-shadow: 0 10px 18px rgba(215, 25, 32, .24);
}

.fk-step--visited:not(.fk-step--active) { color: var(--fk-text); cursor: pointer; }
.fk-step--visited:not(.fk-step--active) .fk-step-number {
  background: #d0d4e8;
  border-color: #b0b6cc;
  color: var(--fk-text);
}

.fk-step-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

/* ── Mobile progress (wizard) ── */

.fk-mobile-progress {
  display: none;
  margin-top: 22px;
  font-size: 14px;
}

.fk-progress-line {
  height: 4px;
  background: #eef0f6;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0;
}

.fk-progress-line span {
  display: block;
  height: 100%;
  background: var(--fk-red);
  transition: width .3s ease;
  width: 0%;
}

/* ── Wizard step visibility ── */

.fk-wizard-step { display: none; }
.fk-wizard-step.fk-wizard-step--active { display: block; }

/* ── Wizard nav ── */

.fk-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 26px;
}

.fk-wizard-actions {
  display: flex;
  gap: 12px;
}

/* ── Status badges ── */

.fk-status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.fk-status-draft { color: #4b63d1; background: #edf2ff; }
.fk-status-submitted { color: #22a85a; background: #eaf8ef; }
.fk-status-fix-requested { color: #991b1b; background: #fee2e2; }
.fk-status-approved { color: #22a85a; background: #eaf8ef; }
.fk-status-rejected { color: #991b1b; background: #fee2e2; }

/* ── Status banner ── */

.fk-status-banner {
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 15px;
}

.fk-status-banner--draft { background: #edf2ff; color: #4b63d1; }
.fk-status-banner--submitted { background: #eaf8ef; color: #22a85a; }
.fk-status-banner--fix_requested { background: #fee2e2; color: #991b1b; }
.fk-status-banner--approved { background: #eaf8ef; color: #22a85a; }
.fk-status-banner--rejected { background: #fee2e2; color: #991b1b; }

/* ── Error summary ── */

.fk-error-summary {
  background: #fef2f2;
  border-left: 4px solid var(--fk-red);
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: 8px;
  color: #991b1b;
  font-weight: 600;
  font-size: 15px;
}

.fk-error-summary ul { margin: 8px 0 0; padding-left: 18px; }
.fk-error-summary a { color: inherit; text-decoration: underline; }

/* ── Source / document badges ── */

.fk-source-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--fk-soft-blue);
  color: var(--fk-blue);
  margin-left: 6px;
  vertical-align: middle;
}

.fk-source-badge--review {
  background: #fff8e1;
  color: #b8860b;
}

.fk-source-badge--active {
  background: #eaf8ef;
  color: #22a85a;
}

.fk-source-badge--inactive {
  background: #f4f6fb;
  color: var(--fk-muted);
}

/* ── Document card ── */

.fk-document-card {
  border: 1px solid var(--fk-border);
  border-radius: var(--fk-radius-md);
  padding: 16px;
  background: var(--fk-white);
  margin-bottom: 12px;
}

.fk-document-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.fk-document-card__kind { font-weight: 700; color: var(--fk-text); }
.fk-document-card__filename { color: var(--fk-muted); font-size: 14px; margin: 0 0 8px; }
.fk-document-card__hint { color: var(--fk-muted); font-size: 13px; font-weight: 400; margin: 0 0 10px; line-height: 1.45; }
.fk-document-card__empty { color: var(--fk-muted); font-size: 14px; margin: 0; font-weight: 400; }

.fk-document-card__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.fk-document-card__status--active {
  background: #eaf8ef;
  color: #22a85a;
}

.fk-document-card__status--inactive {
  background: #f4f6fb;
  color: var(--fk-muted);
}

.fk-link { color: var(--fk-blue); text-decoration: underline; }

.fk-document-card__replace {
  font-size: 13px;
  text-decoration: none;
  padding: 6px 14px;
}

.fk-document-card__replace:hover {
  background: var(--fk-soft-blue);
}

/* ── Summary grid (wizard review step) ── */

.fk-summary-section { margin-bottom: 28px; }
.fk-summary-section:last-of-type { margin-bottom: 8px; }
.fk-summary-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fk-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.fk-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.fk-summary-item {
  background: #fafbff;
  border: 1px solid var(--fk-border);
  border-radius: 12px;
  padding: 16px;
}

.fk-summary-item span {
  display: block;
  color: var(--fk-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.fk-summary-item strong {
  color: var(--fk-text);
  font-size: 15px;
  font-weight: 600;
}

.fk-field-hint {
  margin: 6px 0 0;
  color: #b8860b;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.fk-fine-print {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--fk-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Empty state ── */

.fk-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--fk-muted);
}

.fk-empty-state h2 {
  font-size: 20px;
  color: var(--fk-text);
  margin: 0 0 8px;
}

/* ── Page intro paragraph (helper for muted page-level explanatory copy) ── */

.fk-page-intro {
  margin: 0 0 16px;
  color: var(--fk-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── Page heading ── */

.fk-page-heading { margin-bottom: 24px; }

.fk-page-heading h1 {
  font-size: clamp(38px, 5vw, 62px);
  color: var(--fk-blue);
  margin: 0 0 12px;
}

/* ── Form actions (flat form, non-wizard) ── */

.fk-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ── Responsive ── */

@media (max-width: 980px) {
  .fk-hero-card { grid-template-columns: 1fr; }
  .fk-stepper { overflow-x: auto; padding-bottom: 4px; }
  .fk-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .fk-site-header { position: static; }
  .fk-header-inner { padding: 12px 16px; }
  .fk-brand-logo { width: 58px; height: 58px; }
  .fk-brand-title { font-size: 1.5rem; }
  .fk-brand-subtitle { font-size: 0.86rem; }
  .fk-hero-card { border-radius: 20px; padding: 24px 20px; }
  .fk-hero-card .fk-stepper { display: none; }
  .fk-mobile-progress { display: block; }
  .fk-section-header { padding: 22px 20px 4px; }
  .fk-section-body { padding: 16px 20px 22px; }
  .fk-section-icon { width: 40px; height: 40px; font-size: 19px; }
  .fk-section-header h2 { font-size: 21px; }
  .fk-form-grid .fk-field,
  .fk-form-grid .fk-field--third { grid-column: 1 / -1; }
  .fk-summary-grid { grid-template-columns: 1fr; }
  .fk-wizard-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .fk-wizard-nav .fk-button {
    width: 100%;
    box-sizing: border-box;
    padding: 0 14px;
    font-size: 14px;
  }
  .fk-wizard-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 420px) {
  .fk-brand-title { font-size: 1.2rem; }
  .fk-brand-subtitle { display: none; }
  .fk-hero-card { padding: 22px 18px; }
  .fk-section-header { padding: 20px 16px 4px; }
  .fk-section-body { padding: 14px 16px 20px; }
}

/* ── Portal + helper card mobile polish (P4 Slice E) ── */

.fk-app-meta--review {
  margin-top: 10px;
}

@media (max-width: 720px) {
  .fk-applications {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .fk-application-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .fk-app-actions .fk-button {
    width: 100%;
    box-sizing: border-box;
  }
  .fk-helper-card {
    flex-direction: column;
    align-items: stretch;
  }
  .fk-helper-card .fk-button {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ── OCR summary review list (P4 Slice E follow-up) ── */

.fk-ocr-summary-list {
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.fk-ocr-summary-row {
  display: grid;
  grid-template-columns: minmax(140px, max-content) 1fr;
  gap: 12px;
  align-items: baseline;
}

.fk-ocr-summary-row dt {
  margin: 0;
  color: var(--fk-muted);
  font-size: 0.9rem;
}

.fk-ocr-summary-row dd {
  margin: 0;
  font-weight: 600;
}

/* ── OCR async UX (P4 Slice B) ── */

.fk-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--fk-radius-md);
  background: color-mix(in srgb, var(--fk-soft-blue) 70%, transparent);
  color: var(--fk-blue);
  font-size: 13px;
}

.fk-spinner__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--fk-blue);
  border-top-color: transparent;
  animation: fk-spinner-rotate 0.9s linear infinite;
}

.fk-spinner__label {
  opacity: 0.85;
  font-weight: 600;
}

@keyframes fk-spinner-rotate {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .fk-spinner__dot { animation: none; }
}

.fk-toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--fk-radius-md);
  border: 1px solid color-mix(in srgb, var(--fk-blue) 15%, transparent);
  background: var(--fk-soft-blue);
  color: var(--fk-blue);
  font-size: 13px;
  font-weight: 600;
  animation: fk-toast-fade-in 0.2s ease-out;
}

.fk-toast--success {
  background: #eaf8ef;
  color: #22a85a;
  border-color: color-mix(in srgb, #22a85a 18%, transparent);
}

.fk-toast--warning {
  background: #fff8e1;
  color: #b8860b;
  border-color: color-mix(in srgb, #b8860b 22%, transparent);
}

.fk-toast__message { line-height: 1.35; }

@keyframes fk-toast-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* OCR suggestion chip — align with badge family. */

.fk-ocr-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fk-soft-blue);
  color: var(--fk-blue);
  font-size: 12px;
  font-weight: 600;
}

.fk-ocr-suggestion__label { opacity: 0.75; }
.fk-ocr-suggestion__value { font-weight: 700; }

.fk-ocr-suggestion__accept,
.fk-ocr-suggestion__dismiss {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.fk-ocr-suggestion__accept {
  background: var(--fk-blue);
  color: var(--fk-white);
}

.fk-ocr-suggestion__accept:hover { filter: brightness(1.05); }
.fk-ocr-suggestion__dismiss:hover { background: rgba(15, 8, 81, 0.06); }

.fk-inline-error {
  display: block;
  color: var(--fk-red);
  font-size: 13px;
  line-height: 1.4;
}

/* ── Wizard gating + auto-save (P4 Slice C) ── */

/* Save status pill at the top of the wizard. Fixed min-width
   prevents layout shift as the label cycles SAVING/SAVED/ERROR.
   No green token exists in the design system, so the "saved"
   state intentionally uses the neutral blue tone family. */

.fk-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 96px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--fk-border);
  background: var(--fk-white);
  color: var(--fk-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.fk-save-indicator[data-save-state="saving"] {
  background: var(--fk-bg);
  border-color: var(--fk-border);
  color: var(--fk-muted);
}

.fk-save-indicator[data-save-state="saved"] {
  background: var(--fk-soft-blue);
  border-color: var(--fk-soft-blue);
  color: var(--fk-blue);
}

.fk-save-indicator[data-save-state="error"] {
  background: var(--fk-white);
  border-color: var(--fk-red);
  color: var(--fk-red);
}

.fk-save-indicator__label {
  text-decoration: none;
}

/* Consent block above the documents grid in step 1. */

.fk-consent {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--fk-border);
  border-radius: var(--fk-radius-md);
  background: var(--fk-white);
}

.fk-consent__label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
  cursor: pointer;
}

.fk-consent__label input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--fk-blue);
}

.fk-consent__text {
  flex: 1 1 auto;
  line-height: 1.45;
}

.fk-consent details {
  margin-top: 8px;
}

.fk-consent details > summary {
  cursor: pointer;
  color: var(--fk-blue);
  font-weight: 600;
}

.fk-consent details > *:not(summary) {
  padding: 8px 0 0;
}

/* Disabled CTA — react to either the `:disabled` pseudo or the
   `[disabled]` HTML attribute (JS sets `.disabled = true`). */

[data-wizard-next]:disabled,
[data-wizard-next][disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

[data-wizard-next]:disabled:hover,
[data-wizard-next][disabled]:hover,
[data-wizard-next]:disabled:focus,
[data-wizard-next][disabled]:focus {
  filter: none;
  transform: none;
  box-shadow: none;
}

/* ── P4 Slice D — upload slots, camera affordance, mobile polish ── */

/* Screen-reader-accessible hidden helper. Used by the canonical file input
   inside .fk-upload-slot so the upload button (a <label for>) still works
   and AT users can discover the input via label association. */
.fk-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Upload slot — appears once per document card, holds the canonical hidden
   input + the two visible labels (file + camera). */
.fk-upload-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* Camera control visibility — only show on devices with a coarse pointer
   (touch). Desktop browsers ignore the `capture` attribute, so the camera
   button would just open the regular file picker — redundant. */
@media not (pointer: coarse) {
  .fk-camera-only { display: none; }
}

/* Checkbox row wrapper — used on the consent checkbox + address-sync
   checkbox so the entire row is tappable (not just the 16px native box). */
.fk-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
}

/* Sticky wizard nav (mobile-only). The base .fk-wizard-nav layout stays
   inline; the --sticky modifier opts into sticky positioning, gated by
   `(pointer: coarse) and (max-width: 720px)` so desktop users with narrow
   windows are not affected. */
.fk-wizard-nav--sticky {
  /* No effect outside the mobile media query. */
}

@media (pointer: coarse) and (max-width: 720px) {
  .fk-wizard-nav--sticky {
    position: sticky;
    bottom: 0;
    background: var(--fk-bg, #fff);
    padding: 12px 0;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.04);
    z-index: 10;
  }
}

/* Touch-target floor for form controls is already enforced by the
   `.fk-form-field input/select/textarea` rule above (min-height: 46px),
   which exceeds the Slice D acceptance #5 floor of 44px. No extra
   selectors are needed here. */

/* Container padding (clamp-based, scales with viewport). Applies to
   both the workspace shell and the new-app body. */
.fk-application-workspace,
.fk-workspace {
  padding-inline: clamp(16px, 4vw, 32px);
}

/* Address-sync row — wraps the actual-address input + "same as guardian"
   checkbox. Stacked on mobile so each control has its own row. */
.fk-address-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

@media (max-width: 720px) {
  .fk-address-row {
    flex-direction: column;
    gap: 8px;
  }

  /* Save indicator: move into the flow above the active step so it
     doesn't overlap the sticky CTA. Existing rule pins it absolute
     at top-right of the workspace; the override puts it in normal flow
     and right-aligns it. */
  .fk-save-indicator {
    position: static;
    margin-left: auto;
    margin-bottom: 8px;
  }
}

/* Address autocomplete dropdown. Scoped to the input's positioned parent
   so suggestions render directly under the field without disturbing layout. */
.fk-address-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  padding: 0;
  list-style: none;
  background: var(--fk-white);
  border: 1px solid var(--fk-border);
  border-radius: var(--fk-radius-md);
  box-shadow: var(--fk-shadow);
  max-height: 260px;
  overflow-y: auto;
  z-index: 20;
}

.fk-address-dropdown__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--fk-border);
}

.fk-address-dropdown__item:last-child {
  border-bottom: none;
}

.fk-address-dropdown__item:hover,
.fk-address-dropdown__item--active {
  background: var(--fk-soft-blue);
}

.fk-address-dropdown__label {
  color: var(--fk-text);
}

.fk-address-dropdown__hint {
  flex-shrink: 0;
  color: var(--fk-muted);
  font-size: 0.85em;
  white-space: nowrap;
}

.fk-address-dropdown__message {
  padding: 12px 14px;
  color: var(--fk-muted);
  font-size: 0.9em;
}

/* ── Parent portal invoice section (P12) ── */

.fk-invoice-groups {
  display: grid;
  gap: 16px;
}

.fk-invoice-card {
  background: var(--fk-white);
  border: 1px solid var(--fk-border);
  border-radius: var(--fk-radius-lg);
  padding: 20px;
  box-shadow: var(--fk-shadow-soft);
}

.fk-invoice-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.fk-invoice-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--fk-text);
  margin: 0;
}

.fk-invoice-meta {
  color: var(--fk-muted);
  font-size: 14px;
}

.fk-invoice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.fk-invoice-row {
  display: grid;
  grid-template-columns: 0.6fr 1fr 0.8fr 0.8fr 1fr 1.2fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--fk-border);
}

.fk-invoice-cell {
  font-size: 14px;
  color: var(--fk-text);
}

.fk-invoice-muted {
  color: var(--fk-muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .fk-invoice-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .fk-invoice-row .fk-invoice-cell {
    padding: 2px 0;
  }
}
