/* ==========================================================================
   SmartAdmit parent portal - WIZARDS
   --------------------------------------------------------------------------
   The two step-by-step forms - learner registration (Learners/CreateV2,
   .lrn-wizard) and parent registration (Account/RegisterV2, .reg-wizard) -
   share one vocabulary: .wizard-header (a language switcher and a .stepper),
   .wizard-body with .step-panel sections, .info-banner notes, .citizen-card
   option tiles. Each page carries its own <style> block painting that
   vocabulary as a centred, floating green-headed card.

   LAYOUT. The form uses the whole content area, the way a professional
   application form does, rather than floating in the middle of it:

     >= 1024px  two columns. On the left a sticky rail: language, and the
                steps as a vertical list with a one-line description each,
                the current one marked. On the right the form, edge to edge
                in the content area, in one surface; the step's actions sit
                in a footer bar at its foot.
     <  1024px  one column. The rail becomes a compact progress header
                ("Step 2 of 3", a bar, the step's name); the language pills
                scroll sideways; Back / Next stay pinned above the bottom
                navigation so the next action is always in reach.

   The pages' markup, field names and scripts are untouched. Every selector
   starts with a shell scope so it outranks the page's own <style> block;
   the few !important rules beat inline style="" attributes and are marked.
   ========================================================================== */

/* ---- 0. The page heading ------------------------------------------------ */
/* "Enter Learner Details - STEP 2": the page paints "STEP 2" in #fdb915,
   1.8:1 on white. It becomes a quiet tag. (inline colour -> !important) */
:is(.sa-content, .sa-legacy-page) .section-header h3 span[style*="#fdb915"] {
  color: var(--bc-accent-700) !important; background: var(--bc-accent-50); font-size: var(--bc-fs-xs);
  font-family: var(--bc-font-body); font-weight: var(--bc-fw-semi); letter-spacing: .06em;
  padding: 4px 10px; border-radius: var(--bc-r-pill); vertical-align: 6px; margin-left: 6px; }

/* ---- 1. The two-column frame ------------------------------------------- */
:is(.sa-content, .sa-legacy-page) :is(.lrn-wizard, .reg-wizard) {
  max-width: none; margin: 0; display: grid;
  grid-template-columns: 272px minmax(0, 1fr); gap: var(--bc-s-7); align-items: start; }

:is(.sa-content, .sa-legacy-page) :is(.wizard-header, .wizard-body) { min-width: 0; }
:is(.sa-content, .sa-legacy-page) .lang-switcher { max-width: 100%; }
:is(.sa-content, .sa-legacy-page) .section-header h3 span[style*="#fdb915"] { white-space: nowrap; }
:is(.sa-content, .sa-legacy-page) .wizard-header {
  position: sticky; top: calc(68px + var(--bc-s-5)); align-self: start;
  background: transparent; color: var(--bc-text-body); border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.sa-legacy-page .wizard-header { top: calc(84px + var(--bc-s-5)); }

:is(.sa-content, .sa-legacy-page) .wizard-body {
  background: #fff; border: 1px solid var(--bc-border); border-radius: var(--bc-r-lg);
  box-shadow: var(--bc-sh-sm); padding: 0; overflow: visible; min-width: 0; }
:is(.sa-content, .sa-legacy-page) .wizard-body > form { display: block; }
:is(.sa-content, .sa-legacy-page) .step-panel { padding: var(--bc-s-8); }
/* A step that ends in the footer bar keeps the bar flush with the card's foot; any
   other step (registration step 1: Send code / Verify, Change number) keeps the
   card's bottom padding so its buttons are not pressed against the edge. */
:is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4:last-child { margin-bottom: calc(-1 * var(--bc-s-8)) !important; }
:is(.sa-content, .sa-legacy-page) .wizard-body > form > .alert { margin: var(--bc-s-6) var(--bc-s-8) 0; }

/* ---- 2. Rail: language ------------------------------------------------- */
:is(.sa-content, .sa-legacy-page) .lang-switcher {
  justify-content: flex-start !important; margin: 0 0 var(--bc-s-6) !important; }
:is(.sa-content, .sa-legacy-page) .lang-switcher .btn-group { flex-wrap: wrap; gap: 6px; }
:is(.sa-content, .sa-legacy-page) .lang-switcher .btn {
  border: 1px solid var(--bc-border) !important; border-radius: var(--bc-r-pill) !important; margin: 0 !important;
  background: #fff; color: var(--bc-text-muted); box-shadow: none; flex: none;
  font-size: var(--bc-fs-xs); font-weight: var(--bc-fw-medium); padding: 4px 11px; }
:is(.sa-content, .sa-legacy-page) .lang-switcher .btn:hover { color: var(--bc-text-strong); background: var(--bc-grey-50); }
:is(.sa-content, .sa-legacy-page) .lang-switcher .btn.active {
  background: var(--bc-accent-50); border-color: var(--bc-accent-200) !important; color: var(--bc-accent-700); font-weight: var(--bc-fw-semi); }

/* ---- 3. Rail: the steps as a vertical list ----------------------------- */
:is(.sa-content, .sa-legacy-page) .stepper {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; }
:is(.sa-content, .sa-legacy-page) .stepper-step {
  flex: none; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 14px;
  align-items: start; padding-bottom: var(--bc-s-6); position: relative; text-align: left; }
:is(.sa-content, .sa-legacy-page) .stepper-step:last-child { padding-bottom: 0; }
:is(.sa-content, .sa-legacy-page) .stepper-step:not(:last-child)::after {
  top: 36px; bottom: 4px; left: 15px; width: 2px; height: auto;
  background: var(--bc-grey-200); border-radius: 2px; z-index: 0; }
:is(.sa-content, .sa-legacy-page) .stepper-step.done:not(:last-child)::after { background: var(--bc-accent-300); }
:is(.sa-content, .sa-legacy-page) .step-bubble {
  grid-row: 1 / span 2; width: 32px; height: 32px; background: #fff; border: 1.5px solid var(--bc-border-strong);
  color: var(--bc-text-muted); font-size: var(--bc-fs-xs); font-weight: var(--bc-fw-semi); }
:is(.sa-content, .sa-legacy-page) .stepper-step.active .step-bubble {
  background: var(--bc-accent-500); border-color: var(--bc-accent-500); color: #fff; box-shadow: 0 0 0 4px var(--bc-accent-50); }
:is(.sa-content, .sa-legacy-page) .stepper-step.done .step-bubble {
  background: var(--bc-accent-50); border-color: var(--bc-accent-200); color: var(--bc-accent-600); }
:is(.sa-content, .sa-legacy-page) .step-lbl {
  display: block; white-space: normal; text-align: left; margin: 5px 0 0;
  color: var(--bc-text-muted); font-size: var(--bc-fs-sm); font-weight: var(--bc-fw-medium); line-height: 1.3; }
:is(.sa-content, .sa-legacy-page) .stepper-step.active .step-lbl { color: var(--bc-text-strong); font-weight: var(--bc-fw-semi); }
:is(.sa-content, .sa-legacy-page) .stepper-step.done .step-lbl { color: var(--bc-text-body); }
.sa-step-desc { grid-column: 2; font-size: var(--bc-fs-xs); color: var(--bc-text-muted); line-height: 1.45; margin-top: 3px; }
.stepper-step.active .sa-step-desc { color: var(--bc-text-body); }

/* the rail's help line (sa.wizard.js) */
.sa-wiz-help { margin-top: var(--bc-s-7); padding-top: var(--bc-s-5); border-top: 1px solid var(--bc-border);
  font-size: var(--bc-fs-xs); color: var(--bc-text-muted); line-height: 1.55; }
.sa-wiz-help a { font-weight: var(--bc-fw-semi); }
/* the compact progress header, phones and tablets only (sa.wizard.js) */
.sa-wiz-progress { display: none; }

/* ---- 4. Step heading (injected by sa.wizard.js) -------------------------- */
.sa-step-head { margin: 0 0 var(--bc-s-7); padding-bottom: var(--bc-s-5); border-bottom: 1px solid var(--bc-border-subtle); }
.sa-step-head .bc-eyebrow { color: var(--bc-accent-600); }
.sa-step-head h3 { font-size: 1.5rem; margin: 6px 0 0; line-height: 1.25; }
.sa-step-head p { margin: 6px 0 0; color: var(--bc-text-muted); font-size: var(--bc-fs-sm); max-width: 70ch; }

/* ---- 5. Notes: .info-banner becomes a BCDF explainer -------------------- */
:is(.sa-content, .sa-legacy-page) .info-banner {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bc-accent-50); border: 1px solid color-mix(in srgb, var(--bc-accent-500) 18%, #fff);
  border-radius: var(--bc-r-ctrl); padding: 12px 14px; font-size: var(--bc-fs-sm); line-height: 1.55;
  color: var(--bc-text-body); margin-bottom: var(--bc-s-5); }
:is(.sa-content, .sa-legacy-page) .info-banner > i { color: var(--bc-accent-600) !important; margin-top: 3px; }
:is(.sa-content, .sa-legacy-page) .info-banner.warning {
  background: var(--bc-warning-bg); border-color: color-mix(in srgb, var(--bc-warning) 30%, #fff); }
:is(.sa-content, .sa-legacy-page) .info-banner.warning > i { color: var(--bc-warning) !important; }
/* inline color:#856404 on the warning text -> token (!important beats inline) */
:is(.sa-content, .sa-legacy-page) .info-banner.warning > span { color: var(--bc-warning-fg) !important; }

/* ---- 6. Option tiles --------------------------------------------------- */
:is(.sa-content, .sa-legacy-page) .citizen-card {
  border: 1.5px solid var(--bc-border); border-radius: var(--bc-r-card); padding: 14px 16px; background: #fff;
  transition: border-color var(--bc-transition), box-shadow var(--bc-transition), background var(--bc-transition); }
:is(.sa-content, .sa-legacy-page) .citizen-card:hover { border-color: var(--bc-accent-300); background: #fff; box-shadow: var(--bc-sh-sm); }
:is(.sa-content, .sa-legacy-page) .citizen-card.selected {
  border-color: var(--bc-accent-500); background: var(--bc-accent-50); box-shadow: 0 0 0 3px var(--bc-accent-50); }

/* ---- 7. Fields: spacing between groups --------------------------------- */
:is(.sa-content, .sa-legacy-page) .step-panel .row.g-3 { --bs-gutter-y: 1.25rem; --bs-gutter-x: 1.5rem; }
:is(.sa-content, .sa-legacy-page) .step-panel .form-label { margin-bottom: 6px; }
:is(.sa-content, .sa-legacy-page) .step-panel .form-label .text-danger { color: var(--bc-danger) !important; }
:is(.sa-content, .sa-legacy-page) .step-panel hr { border-color: var(--bc-border-subtle); opacity: 1; margin-block: var(--bc-s-7); }

/* ---- 8. Actions: a footer bar across the foot of the form --------------- */
:is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4 {
  margin: var(--bc-s-8) calc(-1 * var(--bc-s-8)) 0 !important;
  padding: var(--bc-s-4) var(--bc-s-8); background: var(--bc-grey-25);
  border-top: 1px solid var(--bc-border-subtle); border-radius: 0 0 var(--bc-r-lg) var(--bc-r-lg);
  justify-content: space-between; align-items: center; }
:is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4 > .btn.flex-fill { flex: 0 1 auto !important; min-width: 160px; }
:is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4 > .btn:only-child { margin-left: auto; }
/* Next / Submit carry inline style="background:#008131; color:#fff" */
:is(.sa-content, .sa-legacy-page) :is(.lrn-wizard, .reg-wizard, .edit-wizard) .btn[style*="#008131"] {
  background: var(--bc-accent-500) !important; border-color: var(--bc-accent-500) !important; color: #fff !important;
  box-shadow: 0 2px 8px var(--sa-shadow-brand); }
:is(.sa-content, .sa-legacy-page) :is(.lrn-wizard, .reg-wizard, .edit-wizard) .btn[style*="#008131"]:hover {
  background: var(--bc-accent-600) !important; border-color: var(--bc-accent-600) !important; }
:is(.sa-content, .sa-legacy-page) :is(.lrn-wizard, .reg-wizard, .edit-wizard) .btn[style*="#008131"]:disabled {
  background: var(--bc-grey-100) !important; border-color: var(--bc-grey-200) !important; color: var(--bc-text-subtle) !important; box-shadow: none; }

/* ---- 8b. Wide screens: question label beside its answer ---------------- */
.sa-q__body { display: grid; gap: var(--bc-s-3); min-width: 0; }
@media (min-width: 1200px) {
  .sa-q { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); column-gap: var(--bc-s-8); align-items: start; }
  .sa-guide > .sa-q + .sa-q { padding-top: var(--bc-s-6); border-top: 1px solid var(--bc-border-subtle); }
}

/* ---- 8c. Tablet and phone ---------------------------------------------- */
@media (max-width: 1023px) {
  :is(.sa-content, .sa-legacy-page) :is(.lrn-wizard, .reg-wizard) { grid-template-columns: 1fr; gap: var(--bc-s-4); }
  :is(.sa-content, .sa-legacy-page) .wizard-header {
    position: static; background: #fff; border: 1px solid var(--bc-border); border-radius: var(--bc-r-lg);
    padding: var(--bc-s-4); }
  :is(.sa-content, .sa-legacy-page) .lang-switcher { margin: 0 0 var(--bc-s-4) !important; overflow-x: auto; scrollbar-width: none; }
  :is(.sa-content, .sa-legacy-page) .lang-switcher .btn-group { flex-wrap: nowrap; }
  :is(.sa-content, .sa-legacy-page) .stepper { display: none; }
  .sa-wiz-help { display: none; }
  .sa-wiz-progress { display: block; }
  .sa-wiz-progress__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--bc-s-3); margin-bottom: 8px; }
  .sa-wiz-progress__name { font-family: var(--bc-font-display); font-weight: var(--bc-fw-semi); color: var(--bc-text-strong); }
  .sa-wiz-progress__count { font-size: var(--bc-fs-xs); color: var(--bc-text-muted); white-space: nowrap; }
  .sa-wiz-progress .bc-progress { height: 6px; }
  :is(.sa-content, .sa-legacy-page) .step-panel { padding: var(--bc-s-6) var(--bc-s-5); }
  :is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4:last-child { margin-bottom: calc(-1 * var(--bc-s-6)) !important; }
  :is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4 {
    margin: var(--bc-s-7) calc(-1 * var(--bc-s-5)) 0 !important; padding: var(--bc-s-3) var(--bc-s-5); }
  .sa-step-head .bc-eyebrow { display: none; }  /* the progress header says it */
}
@media (max-width: 767px) {
  :is(.sa-content, .sa-legacy-page) .wizard-body { border-radius: var(--bc-r-card); }
  :is(.sa-content, .sa-legacy-page) .step-panel { padding: var(--bc-s-5) var(--bc-s-4) var(--bc-s-6); }
  :is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4:last-child { margin-bottom: calc(-1 * var(--bc-s-6)) !important; }
  .sa-step-head { margin-bottom: var(--bc-s-5); }
  .sa-step-head h3 { font-size: 1.25rem; }
  /* Back / Next pinned above the portal's bottom navigation */
  :is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4 {
    position: sticky; bottom: 0; z-index: 5;
    margin: var(--bc-s-6) calc(-1 * var(--bc-s-4)) 0 !important; padding: 12px var(--bc-s-4);
    background: rgba(255,255,255,.96); backdrop-filter: blur(6px); box-shadow: 0 -6px 18px rgba(0,0,0,.06);
    border-radius: 0 0 var(--bc-r-card) var(--bc-r-card); }
  .sa-portal :is(.sa-content) .step-panel > .d-flex.gap-2.mt-4 { bottom: calc(62px + env(safe-area-inset-bottom)); }
  :is(.sa-content, .sa-legacy-page) .step-panel > .d-flex.gap-2.mt-4 > .btn.flex-fill { flex: 1 1 0 !important; min-width: 0; }
}

/* Section 9 (the School & grade guide for Learners/CreateV2) was removed in the
   rebuild: the learner form has its own stylesheet, wwwroot/css/pages/learner-form.css. */
