/* Text size: the website's theme sets html { font-size: 10px }, so plain rem came out at
   10px (form text at 12px). --fc-rem is the site's normal text size; every rem in the
   form's CSS is written calc(N * var(--fc-rem)) (tools/scope-css.py does it for the
   generated file). */
:root { --fc-rem: 17px; }
.fc-eforms { font-size: var(--fc-rem); }

/* What the server-rendered pages add to the prototype's stylesheet (app/css/eforms-scoped.css):
   the progress badges and the side list are buttons now (a page is reached by a POST), a
   held file can be dropped, the code step on the review page, the fee on the list. */
.fc-eforms button.progress-step,
.fc-eforms .step-item .sn-go {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: inherit; width: 100%; text-align: inherit;
}
.fc-eforms button.progress-step { width: auto; }
.fc-eforms .step-item .sn-go { width: 100%; }
.fc-eforms .step-item.skipped, .fc-eforms .progress-step.skipped { opacity: 0.35; }
.fc-eforms .conditional-hidden { display: none !important; }
.fc-eforms .file-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fc-eforms .file-wrap .extra-files { flex-basis: 100%; display: grid; gap: 6px; }
.fc-eforms .file-drop { font-size: calc(0.85 * var(--fc-rem)); color: var(--color-error, #d32f2f); }
.fc-eforms .file-drop input { margin-inline-end: 4px; }
.fc-eforms .otp-block { margin-top: 16px; padding: 14px 16px; background: var(--color-primary-light, #f6ecf1); border-radius: var(--radius, 10px); }
.fc-eforms .otp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.fc-eforms .form-fee { font-size: calc(0.82 * var(--fc-rem)); color: var(--color-text-secondary, #6b6069); margin-inline-start: 8px; }
.fc-eforms .status-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fc-eforms .status-box input { font-family: var(--font-en, system-ui); letter-spacing: 0.1em; }
.fc-eforms .ref-quiet { opacity: 0.7; font-size: calc(0.85 * var(--fc-rem)); }
.fc-eforms .date-wrap { position: relative; display: flex; align-items: center; gap: 6px; }
.fc-eforms .date-native { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.fc-eforms .date-cal { background: none; border: 1px solid var(--color-border, #e6dee2); border-radius: 6px; padding: 6px; cursor: pointer; color: var(--color-primary, #6d1a41); }
.fc-eforms .selfie-capture-area .file-input { margin-top: 8px; }
.fc-eforms .step-errors ul { margin: 6px 0 0; padding-inline-start: 18px; }
.fc-eforms .step-err-link { background: none; border: 0; padding: 0; color: var(--color-primary, #6d1a41); text-decoration: underline; cursor: pointer; font: inherit; }
.fc-eforms .form-list a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fc-eforms .wizard-nav button[style*="visibility:hidden"] { pointer-events: none; }

/* The landing page, the status page and the receipt: the prototype kept these rules inside
   index.html and demo-status.html rather than in its stylesheet; carried over, scoped. */
.fc-eforms .home-wrap { max-width: 880px; margin: 0 auto; padding: 12px 18px 48px; }
.fc-eforms .hero { background: linear-gradient(170deg, #fbeef4 0%, #f7f4f6 78%); border-radius: 24px; padding: 52px 40px 46px; margin: 24px 0 24px; text-align: center; }
.fc-eforms .hero h1 { color: var(--color-primary-dark); margin: 0 0 16px; font-size: calc(2.1 * var(--fc-rem)); line-height: 1.75; font-weight: normal; font-family: var(--fc-font-heading); }
.fc-eforms .hero-btn { display: inline-flex; align-items: center; gap: 10px; background: var(--color-primary); color: #fff; font-weight: 700; border: none; padding: 17px 48px; border-radius: 14px; font-size: calc(1.6 * var(--fc-rem)); text-decoration: none; box-shadow: 0 8px 22px rgba(109,26,65,0.30); transition: transform .12s, box-shadow .12s; }
.fc-eforms .hero-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(109,26,65,0.40); }
.fc-eforms .status-box { background: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; border: 1px solid var(--color-border); }
.fc-eforms .status-box .lbl { font-size: calc(0.92 * var(--fc-rem)); font-weight: 600; flex: 1; min-width: 220px; }
.fc-eforms .status-box input { direction: ltr; text-align: center; letter-spacing: 1px; border: 1.5px solid var(--color-border); border-radius: 8px; padding: 9px 12px; width: 170px; font-size: calc(0.95 * var(--fc-rem)); }
.fc-eforms .forms-list h2 { font-size: calc(1.15 * var(--fc-rem)); margin: 26px 0 10px; color: var(--color-primary-dark); }
.fc-eforms .form-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fc-eforms .form-list li a { background: #fff; border: 1px solid var(--color-border); border-right: 4px solid var(--color-primary); border-radius: 14px; padding: 14px 18px; text-decoration: none; color: var(--color-text); font-size: calc(1 * var(--fc-rem)); font-weight: 700; line-height: 1.85; transition: box-shadow .12s; }
.fc-eforms .form-list li a:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.07); }
.fc-eforms .ref-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(109, 26, 65, 0.12); }
.fc-eforms .form-instruction { color: var(--color-text-secondary); margin: 8px 0 0; }
.fc-eforms .status-badge { display: inline-block; padding: 6px 16px; border-radius: 999px; background: var(--color-primary-light, #f6ecf1); color: var(--color-primary, #6d1a41); font-weight: 600; }
.fc-eforms .status-badge.status-approved, .fc-eforms .status-badge.status-completed { background: #e6f4ea; color: #1e6b33; }
.fc-eforms .status-badge.status-rejected { background: #fdecea; color: #a12121; }
.fc-eforms .status-badge.status-returned { background: #fff3cd; color: #6b4d00; }
.fc-eforms .submit-success-panel { text-align: center; padding: 24px 12px; }
.fc-eforms .success-icon { width: 64px; height: 64px; border-radius: 50%; background: #e6f4ea; color: #1e6b33; font-size: calc(2 * var(--fc-rem)); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.fc-eforms .fc-eforms-link { margin: 12px 0; }

/* The form-finding wizard (the prototype kept these rules inside wizard.html). */
.fc-eforms .wizard-card { max-width: 680px; margin: 22px auto; background: #fff; border-radius: 16px; padding: 32px 34px; box-shadow: 0 6px 24px rgba(69,18,44,0.08); }
.fc-eforms .wizard-q { font-size: calc(1.22 * var(--fc-rem)); font-weight: 700; margin-bottom: 6px; line-height: 1.9; }
.fc-eforms .wizard-opt { display: block; width: 100%; text-align: right; padding: 16px 20px; margin: 10px 0; border: 1.5px solid var(--color-border); border-radius: 12px; background: #fbf8fa; cursor: pointer; font-family: inherit; font-size: calc(1.05 * var(--fc-rem)); transition: all .15s; color: var(--color-text); }
.fc-eforms .wizard-opt:hover, .fc-eforms .wizard-opt.selected { border-color: var(--color-primary); background: #f6ecf1; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(69,18,44,0.08); }
.fc-eforms .wizard-nav-row { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.fc-eforms .wizard-back { background: #fff; border: 2px solid var(--color-primary); color: var(--color-primary); cursor: pointer; font-family: inherit; font-size: calc(1.1 * var(--fc-rem)); font-weight: 700; padding: 13px 26px; border-radius: 12px; flex: 1; }
.fc-eforms .wizard-back:hover { background: #f6ecf1; }
.fc-eforms .wizard-restart { background: none; border: 1px solid var(--color-border); color: #7a6b73; cursor: pointer; font-family: inherit; font-size: calc(0.95 * var(--fc-rem)); padding: 13px 18px; border-radius: 12px; }
.fc-eforms .wizard-restart:hover { color: var(--color-primary); border-color: var(--color-primary); }
.fc-eforms .juris-note { background: #fff7e0; border: 1px solid #eedc9a; border-radius: 12px; padding: 16px 20px; margin-bottom: 14px; line-height: 1.85; }
.fc-eforms .juris-note.fail { background: #fdecec; border-color: #f0b4b4; text-align: center; padding: 22px 20px; }
.fc-eforms .juris-note.fail p { margin: 0; font-size: calc(1.15 * var(--fc-rem)); font-weight: 700; color: #8a1f1f; line-height: 2; }
.fc-eforms .juris-q { margin-bottom: 20px; }
.fc-eforms .juris-q .field-label { font-weight: 700; font-size: calc(1.02 * var(--fc-rem)); line-height: 1.9; }
.fc-eforms .juris-island { display: flex; gap: 10px; margin-top: 8px; margin-bottom: 8px; }
.fc-eforms .juris-island.conditional-hidden { display: none; }
.fc-eforms .juris-island select { flex: 1; min-width: 0; }
.fc-eforms .juris-continue { width: 100%; margin-top: 6px; padding: 15px 24px; font-size: calc(1.1 * var(--fc-rem)); }
.fc-eforms .progress-step.prefilled, .fc-eforms .step-item.prefilled { opacity: 0.55; }

/* ── Mobile pass (2026-11-15), Apple HIG and Material 3 as the reference ─────────────────────
   Found by the four-form click-through at 390 and 360 px. Sizes are px, not rem: the website's
   own root size is not ours to rely on. */

/* Text in a field at 16px or more: below that iOS zooms the page when the field is tapped. */
.fc-eforms .field-input, .fc-eforms select, .fc-eforms textarea,
.fc-eforms input[type="text"], .fc-eforms input[type="tel"], .fc-eforms input[type="email"],
.fc-eforms input[type="number"], .fc-eforms .status-box input { font-size: var(--fc-rem); }

/* A focus that can be seen (non-text contrast 3:1), for keyboards and switch access. */
.fc-eforms a:focus-visible, .fc-eforms button:focus-visible, .fc-eforms input:focus-visible,
.fc-eforms select:focus-visible, .fc-eforms textarea:focus-visible, .fc-eforms .field-input:focus {
  outline: 2px solid var(--color-primary, #6d1a41); outline-offset: 2px;
}

/* The link back above every form: it sat white on a light page (1.06:1), 13px, 23px tall.
   Now the theme colour, a full-size target; the arrow points right, the way back in Dhivehi. */
.fc-eforms .back-link {
  color: var(--color-primary, #6d1a41); font-size: var(--fc-rem); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px;
}
.fc-eforms .back-link:hover { color: var(--color-primary-dark, #4a1030); text-decoration: underline; }

@media (max-width: 600px) {
  /* Reading text at 16px. */
  .fc-eforms .field-label, .fc-eforms .form-instruction, .fc-eforms .wizard-opt,
  .fc-eforms .radio-option, .fc-eforms .checkbox-option, .fc-eforms .status-box .lbl { font-size: var(--fc-rem); }
  .fc-eforms .field-hint, .fc-eforms .field-error { font-size: 14px; }
  .fc-eforms .ref-notice-big .dv { font-size: 15px; }

  /* Every control 44 x 44 or more (Apple 44pt, Material 48dp with spacing). */
  .fc-eforms .btn, .fc-eforms .btn-sm, .fc-eforms .date-cal, .fc-eforms .wizard-back,
  .fc-eforms .wizard-restart, .fc-eforms .step-err-link, .fc-eforms .dv-kb-btn {
    min-height: 44px; min-width: 44px;
  }
  .fc-eforms .btn-sm, .fc-eforms .ref-notice-big .btn-sm { font-size: 15px; padding: 8px 14px; }
  .fc-eforms .form-table .btn-sm { min-height: 44px; }
  .fc-eforms .date-cal { display: inline-flex; align-items: center; justify-content: center; }
  .fc-eforms .step-errors li { padding: 6px 0; }

  /* The page badges: one row that scrolls sideways, each badge a 44px target, instead of
     three rows of 26px badges pushing the first question below the fold. */
  .fc-eforms .progress-steps {
    flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 4px 2px 8px;
    justify-content: flex-start;   /* centred, an overflowing row cuts off its start and cannot scroll back to it */
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .fc-eforms .progress-step, .fc-eforms button.progress-step { scroll-snap-align: center; }
  .fc-eforms .wizard-progress { margin-bottom: 16px; }

  /* Back and next (stacked full width by form.css below 600px): taller, easier to hit. */
  .fc-eforms .wizard-nav .btn { min-height: 52px; font-size: 17px; }
}

/* ── 0.7.0: UX.md part 2, as the project lead chose on 2026-11-17 ──────────────────────────── */

/* Text only a screen reader hears (the field named in its error, a step's name and state). */
.fc-eforms .fc-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Headings in the website's own heading face, MV Waheed (loaded by the site's theme; Faruma
   where it is missing); body text, labels and fields stay Faruma. Sizes from --fc-rem:
   h1 28px, h2 22px, h3 19px, text 17px. The theme's own h1–h3 rules are overridden here. */
.fc-eforms { --fc-font-heading: "MV Waheed", "Faruma", "FC Thaana", sans-serif; }
.fc-eforms h1, .fc-eforms h2, .fc-eforms h3 { text-transform: none; letter-spacing: normal; }
.fc-eforms h1.form-title, .fc-eforms .form-title-area h1.form-title, .fc-eforms h1.success-title {
  font-family: var(--fc-font-heading); font-size: calc(1.65 * var(--fc-rem)); font-weight: normal;
  color: var(--color-primary-dark, #45122c); line-height: 1.7; margin: 0 0 8px;
}
.fc-eforms h1.wizard-q {
  font-family: var(--fc-font-heading); font-size: calc(1.3 * var(--fc-rem)); font-weight: normal;
  color: var(--color-text, #23131c); line-height: 1.8; margin: 0 0 6px;
}
.fc-eforms h2.section-title {
  font-family: var(--fc-font-heading); font-size: calc(1.3 * var(--fc-rem)); font-weight: normal; line-height: 1.8;
}
.fc-eforms .instructions-block h3.instructions-heading, .fc-eforms h3.court-use-title,
.fc-eforms h3.export-title {
  font-family: var(--fc-font-heading); font-size: calc(1.12 * var(--fc-rem)); font-weight: normal;
  color: var(--color-primary-dark, #45122c); line-height: 1.8;
}
.fc-eforms .instructions-block h3.instructions-heading { margin: 14px 0 6px; }
.fc-eforms .payment-step-panel h3.payment-title { font-family: var(--fc-font-heading); font-weight: normal; }
.fc-eforms[dir="rtl"] h1.form-title .dv, .fc-eforms[dir="rtl"] h2.section-title .dv { line-height: inherit; }

/* One question's radios or ticks: a fieldset, the question its legend (drawn as the label was). */
.fc-eforms fieldset.field-group, .fc-eforms fieldset.attachments-checklist { min-width: 0; margin-inline: 0; }
.fc-eforms fieldset.field-group { border: 0; padding: 0; }
.fc-eforms legend.field-label, .fc-eforms legend.checklist-legend { float: none; width: auto; max-width: 100%; padding: 0; }

/* Radio and tick circles 24px (were 18px), inside the option cards. */
.fc-eforms .radio-option input[type="radio"], .fc-eforms .checkbox-option input[type="checkbox"] { width: 24px; height: 24px; }

/* The page badges: larger circles (the lead chose these over a line of text and a bar), each
   44 x 44 at every width, the numbers at a readable size. They wrap on a wide screen and scroll
   sideways inside their own strip on a phone (rules above), never the page. */
.fc-eforms .wizard-progress { max-width: 100%; min-width: 0; }
.fc-eforms .progress-steps { gap: 8px; max-width: 100%; position: relative; }
.fc-eforms .progress-step, .fc-eforms button.progress-step {
  position: relative; /* holds its unseen name inside the strip, or it widens the page */
  flex: 0 0 auto; width: 44px; min-width: 44px; height: 44px; padding: 0;
  justify-content: center; font-size: 16px; font-weight: 600;
}
.fc-eforms .progress-step .dv { font-size: 18px; }
.fc-eforms div.progress-step { cursor: default; border-style: dashed; }
.fc-eforms div.progress-step:hover { border-color: var(--color-border); color: var(--color-text-secondary); }
.fc-eforms div.progress-step.skipped { opacity: 0.35; }
.fc-eforms div.progress-step.prefilled { opacity: 0.55; }

/* Errors: the list above the page takes the focus; each entry names the field. */
.fc-eforms .step-errors { margin: 0 0 18px; }
.fc-eforms .step-errors:focus { outline: 3px solid var(--color-error, #d32f2f); outline-offset: 2px; }
.fc-eforms .step-err-link { text-align: start; line-height: inherit; }

/* "Start again": at the foot, quiet, a link in look; it asks on a page of its own. */
.fc-eforms .form-restart-row { justify-content: center; margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--color-border, #e6dee2); }
.fc-eforms .wizard-restart.form-restart-link {
  border: 0; background: none; text-decoration: underline; text-underline-offset: 3px;
  color: var(--color-text-secondary, #6b6069); min-height: 44px; padding: 8px 12px; font-size: calc(0.9 * var(--fc-rem));
}
.fc-eforms .wizard-restart.form-restart-link:hover { color: var(--color-primary, #6d1a41); }
.fc-eforms .restart-confirm .restart-actions { margin-top: 24px; gap: 12px; }

/* Test mode (FC_EFORMS_TEST_MODE, dev only; docs/TESTING.md): a banner on every page and the
   fill panel under each form page. Deliberately unlike the court's colours. */
.fc-test-banner { background: #fff4d6; border: 2px dashed #b7791f; color: #5c3d00; border-radius: 10px; padding: 10px 14px; margin: 0 auto 16px; max-width: 880px; font-size: var(--fc-rem); line-height: 1.8; text-align: center; }
.fc-test-banner p { margin: 0; }
.fc-test-banner .dv { font-family: Faruma, "MV Faseyha", sans-serif; }
.fc-eforms .fc-test-panel { margin: 24px 0 0; padding: 14px 16px; border: 2px dashed #b7791f; border-radius: 12px; background: #fffaf0; text-align: left; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: calc(0.9 * var(--fc-rem)); line-height: 1.5; }
.fc-eforms .fc-test-panel .fc-test-title { margin: 0 0 8px; color: #5c3d00; }
.fc-eforms .fc-test-panel label { display: block; margin-bottom: 4px; }
.fc-eforms .fc-test-panel input { direction: ltr; width: 100%; max-width: 220px; min-height: 44px; padding: 8px 12px; border: 1.5px solid #b7791f; border-radius: 8px; font-size: var(--fc-rem); }
.fc-eforms .fc-test-panel input + label { margin-top: 10px; }
.fc-eforms .fc-test-panel #seedName { direction: rtl; text-align: right; font-family: Faruma, "MV Faseyha", sans-serif; max-width: 320px; }
.fc-eforms .fc-test-panel #seedEmail { max-width: 420px; }
.fc-eforms .fc-test-panel .fc-test-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.fc-eforms .fc-test-panel .fc-test-actions .btn { min-height: 44px; }
.fc-eforms .fc-test-panel .fc-test-error { color: #8a1f1f; margin: 6px 0 0; font-weight: 600; }
.fc-eforms .fc-test-panel .fc-test-note { margin: 8px 0 0; color: #6b6069; font-size: calc(0.85 * var(--fc-rem)); }

/* ── 0.9.1: Mixed Dhivehi and English (docs/THEME.md) ─────────────────────────────────────────
   The pages are right to left (the container is dir="rtl" lang="dv"). English is marked
   lang="en" dir="ltr" on the element that holds it, or a <span class="fc-en" lang="en"
   dir="ltr"> round the run inside a Dhivehi sentence (FC_EForms_Render::mixed(), setMixed() in
   the script); codes (a reference, a phone number, a date, an email) are isolated with
   dir="ltr" or <bdi dir="ltr">. Marked English reads in the system's Latin face, not the
   Thaana fonts (the prototype's --font-en starts with FC Thaana). */
.fc-eforms { --fc-font-latin: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif; }
.fc-eforms [lang="en"] { --font-en: var(--fc-font-latin); font-family: var(--fc-font-latin); }
.fc-eforms [lang="en"] [lang="dv"], .fc-eforms [lang="en"] .dv { font-family: var(--font-dv); }
/* inside a line of Dhivehi: kept apart from the text around it, in its own direction */
.fc-eforms [dir="ltr"], .fc-eforms bdi { unicode-bidi: isolate; }
/* 0.9.2: the dir attribute is only a default; the website theme's custom.css sets
   "p, td { direction: rtl }", which beat it, so marked English in a paragraph or a table cell
   still ran right to left (the full stop at the wrong end). The plugin's own marks win here. */
.fc-eforms [dir="ltr"] { direction: ltr; }
.fc-eforms [dir="rtl"] { direction: rtl; }
.fc-eforms .fc-en { font-size: 0.94em; }   /* the Latin face runs larger than Faruma at one size */
/* a whole block in English starts at the left (low specificity, (0,1,0): a component's own
   alignment wins, e.g. the centred test banner below) */
.fc-eforms :where(p, div, li, label):where([lang="en"]) { text-align: left; }
.fc-test-banner p { text-align: center; }
/* fields that take a code, a number, a date or an email: typed left to right, though the
   prototype's rtl.css turns every input right to left; they keep the form's right edge, as the
   prototype's phone and date fields do */
.fc-eforms[dir="rtl"] input[dir="ltr"], .fc-eforms[dir="rtl"] input[dir="ltr"]::placeholder { direction: ltr; }
/* the browser copy of the draft (ADR-010 step 2): the notice after a reload, the note under the form;
   shown by the script only ([hidden] wins over the notice's own display) */
.fc-eforms .fc-draft-restored[hidden], .fc-eforms .fc-draft-note[hidden], .fc-eforms .fc-draft-cleared[hidden] { display: none; }
.fc-eforms .fc-draft-restored .fc-draft-undo { margin-inline-start: 8px; }
.fc-eforms .fc-draft-note { margin: 16px 0 0; text-align: center; }
.fc-eforms .fc-draft-note .field-hint { margin: 0 0 8px; }
