/* Sign-in, password and school-signup screens. Loaded last in layouts/auth.php. */
body.auth-body {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(201, 141, 74, .16), transparent 60%),
    radial-gradient(700px 480px at -10% 110%, rgba(11, 117, 81, .12), transparent 60%),
    var(--brand-cream);
}

/* ---------- Phone: logo band, then a sheet-like card ---------- */
.auth-hero { padding: calc(1.4rem + env(safe-area-inset-top, 0px)) 1rem .9rem; }
.auth-panel { flex: 1; padding: 0 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); background: transparent; display: flex; flex-direction: column; }
.auth-card {
  width: 100%; max-width: 460px; margin: 0 auto; padding: 1.5rem 1.25rem 1.6rem;
  background: #fff; border: 1px solid var(--border-color) !important; border-radius: 24px;
  box-shadow: 0 18px 50px rgba(45, 79, 74, .12); animation: em-rise .45s var(--ease) both;
}
.auth-shell--wide .auth-card { max-width: 560px; }
.auth-legal { margin: 1.1rem 0 0; text-align: center; font-size: .74rem; color: #a08f78; }
.auth-kicker { margin: 0 0 .25rem; }
.auth-card .page-title { margin: 0 0 .35rem; font-family: var(--font-display); }
.auth-card .page-lead { color: var(--text-muted); font-size: .94rem; margin-bottom: 1.35rem; }

/* fields */
.auth-field { margin-bottom: 1rem; }
.auth-field label { display: block; margin-bottom: .35rem; font-size: .82rem; font-weight: 700; color: var(--brand-forest); }
.auth-field__row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-field__row label { margin-bottom: .35rem; }
.auth-forgot { font-size: .8rem; text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }
.auth-opt { font-weight: 600; font-size: .7rem; color: #a08f78; text-transform: uppercase; letter-spacing: .06em; margin-left: .3rem; }
.auth-input {
  display: flex; align-items: center; gap: .65rem; min-height: 52px; padding: 0 .85rem;
  background: #fcfaf5 !important; border: 1.5px solid #e3dccf !important; border-radius: 14px !important;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input > i:first-child { color: var(--brand-gold-text); font-size: 1.05rem; flex: 0 0 auto; }
.auth-input:hover { border-color: #d3c6ab !important; }
.auth-field.has-error .auth-input { border-color: #b42318 !important; background: #fff8f7 !important; }
.auth-field.has-error .auth-input:focus-within { box-shadow: 0 0 0 4px rgba(180, 35, 24, .14) !important; }
.auth-eye { border: 0; background: none; color: var(--text-muted); width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; margin-right: -.3rem; }
.auth-eye:hover { background: #f4ecdc; color: var(--brand-forest); }
.auth-err { margin: .35rem 0 0; font-size: .78rem; color: #b42318; font-weight: 600; display: flex; gap: .35rem; align-items: center; }
.auth-err::before { content: "\F333"; font-family: "bootstrap-icons"; }
.auth-err[hidden] { display: none; }
.auth-caps { margin: .4rem 0 0; font-size: .78rem; font-weight: 700; color: #b54708; display: flex; gap: .4rem; align-items: center; }
.auth-caps[hidden] { display: none; }

/* buttons */
.auth-submit, .wiz__nav .btn {
  position: relative; min-height: 52px; border-radius: 14px !important; font-weight: 700; font-size: 1rem;
}
.auth-submit { width: 100%; margin-top: .4rem; }
.btn-primary.auth-submit, .wiz__nav .btn-primary { background: linear-gradient(135deg, var(--brand-forest), var(--brand-green)) !important; border: 0 !important; box-shadow: 0 10px 22px rgba(45, 79, 74, .28); }
.btn-primary.auth-submit:hover, .wiz__nav .btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.auth-submit__spin { display: none; }
.is-loading { pointer-events: none; }
.is-loading .auth-submit__label { opacity: 0; }
.is-loading .auth-submit__spin {
  display: block; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: au-spin .7s linear infinite;
}
@keyframes au-spin { to { transform: rotate(360deg); } }

.auth-divider { display: flex; align-items: center; gap: .8rem; margin: 1.4rem 0 1rem; color: #a08f78; font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }
.auth-alt {
  display: flex; align-items: center; gap: .85rem; padding: .8rem .95rem; text-decoration: none; color: var(--brand-forest);
  border: 1.5px dashed #d8c9aa; border-radius: 16px; background: #fcf9f1; transition: border-color .15s, background .15s, transform .15s var(--ease);
}
.auth-alt:hover { background: #fff7ea; border-color: var(--brand-gold); transform: translateY(-1px); }
.auth-alt > i:first-child { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #f4ecdc; color: var(--brand-gold-text); font-size: 1.2rem; }
.auth-alt span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.auth-alt small { color: var(--text-muted); font-size: .78rem; }
.auth-alt > i:last-child { color: var(--brand-gold-text); }
.auth-switch { text-align: center; margin: 1.2rem 0 0; font-size: .9rem; }

/* ---------- Wizard ---------- */
.wiz__steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; margin: 0 0 .6rem; padding: 0; }
.wiz__dot button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .35rem; border: 0; background: none; padding: .2rem 0; color: #a08f78; }
.wiz__dot button:disabled { cursor: default; }
.wiz__num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .88rem;
  background: #f4ecdc; color: var(--brand-brown); border: 2px solid #e3dccf; transition: all .25s var(--ease);
}
.wiz__num i { display: none; }
.wiz__label { font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.wiz__dot.is-current .wiz__num { background: var(--brand-forest); border-color: var(--brand-forest); color: #fff; box-shadow: 0 0 0 5px rgba(45, 79, 74, .14); }
.wiz__dot.is-current .wiz__label { color: var(--brand-forest); }
.wiz__dot.is-done .wiz__num { background: var(--brand-green); border-color: var(--brand-green); color: #fff; }
.wiz__dot.is-done .wiz__num span { display: none; }
.wiz__dot.is-done .wiz__num i { display: block; }
.wiz__dot.is-done .wiz__label { color: var(--brand-green); }
.wiz__bar { height: 4px; border-radius: 4px; background: #eadfc9; margin: 0 0 1.4rem; overflow: hidden; }
.wiz__bar i { display: block; height: 100%; width: 25%; border-radius: 4px; background: linear-gradient(90deg, var(--brand-gold), var(--brand-green)); transition: width .4s var(--ease); }
.wiz__step { animation: none; }
.wiz__step.is-in { animation: wiz-in .35s var(--ease) both; }
@keyframes wiz-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.wiz__step[hidden] { display: none; }
.wiz__h { margin: 0 0 1.1rem; display: flex; flex-direction: column; gap: .15rem; }
.wiz__h span { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--brand-forest); }
.wiz__h small { color: var(--text-muted); font-size: .84rem; }
.wiz__nav { display: flex; gap: .7rem; margin-top: 1.4rem; }
.wiz__nav .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.wiz__nav .wiz__back { flex: 0 0 auto; padding: 0 1.2rem; }
.wiz__nav [hidden] { display: none !important; }
.wiz__review { margin: 0; border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; }
.wiz__review > div { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: .6rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid #efe7d6; background: #fff; }
.wiz__review > div:nth-child(odd) { background: #fcfaf5; }
.wiz__review > div:last-child { border-bottom: 0; }
.wiz__review dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: #a08f78; font-weight: 800; }
.wiz__review dd { margin: 0; font-weight: 600; color: var(--brand-forest); overflow-wrap: anywhere; }
.wiz__edit { border: 0; background: none; color: var(--brand-green); font-weight: 700; font-size: .8rem; padding: .2rem .4rem; border-radius: 8px; }
.wiz__edit:hover { background: #eaf5ef; }
.wiz__note { margin: 1rem 0 0; padding: .75rem .9rem; display: flex; gap: .6rem; font-size: .84rem; color: var(--brand-brown); background: #fff7ea; border: 1px solid #ecd7b6; border-radius: 12px; }
.wiz__note i { color: var(--brand-gold-text); margin-top: .1rem; }
.auth-card .pw-meter { margin-top: .2rem; }

@media (max-width: 420px) {
  .wiz__label { font-size: .64rem; }
  .wiz__review > div { grid-template-columns: 1fr auto; }
  .wiz__review dt { grid-column: 1 / -1; }
  .wiz__review dd { grid-column: 1; }
  .wiz__edit { grid-column: 2; grid-row: 2; }
}

/* ---------- Desktop: split screen ---------- */
@media (min-width: 992px) {
  .auth-shell { display: grid; grid-template-columns: minmax(420px, 44%) 1fr; min-height: 100dvh; }
  .auth-hero { display: none; }
  .auth-visual {
    display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; position: sticky; top: 0; height: 100dvh; padding: 2.5rem 3rem; overflow: hidden; color: #fff;
    background:
      radial-gradient(520px 360px at 90% 8%, rgba(233, 180, 118, .38), transparent 60%),
      radial-gradient(500px 420px at 0% 100%, rgba(11, 117, 81, .55), transparent 62%),
      linear-gradient(155deg, var(--brand-forest-deep) 0%, var(--brand-forest) 55%, #2f6a5c 100%);
  }
  .auth-visual::before {
    content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
    background-image: radial-gradient(#fff 1.2px, transparent 1.2px); background-size: 26px 26px;
  }
  .auth-visual::after { content: none; }
  .auth-visual > * { position: relative; z-index: 1; }
  .auth-visual__brand { display: flex; align-items: center; gap: .8rem; font-family: var(--font-display); font-size: 1.45rem; color: #fff; }
  .auth-visual__brand .em-logo-badge { background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
  .auth-visual__kicker { color: var(--brand-gold-soft); text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 800; margin-bottom: .8rem; }
  .auth-visual__title { color: #fff; font-family: var(--font-display) !important; font-size: clamp(1.7rem, 2.6vw, 2.35rem); line-height: 1.2; margin: 0 0 1.8rem; max-width: 20ch; }
  .auth-visual__points { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
  .auth-visual__points li { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .auth-visual__points i { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(241, 217, 180, .18); color: var(--brand-gold-soft); font-size: 1.15rem; }
  .auth-visual__points span { font-size: .92rem; line-height: 1.35; color: rgba(255,255,255,.88); }
  .auth-visual__points strong { color: #fff; }
  .auth-visual__foot { margin: 0; font-size: .82rem; color: rgba(255,255,255,.7); display: flex; gap: .5rem; align-items: center; }
  .auth-panel { justify-content: center; padding: 2.5rem 3rem; min-height: 100dvh; }
  .auth-card { padding: 2.3rem 2.2rem; }
  .auth-shell--wide .auth-card { max-width: 600px; }
}
@media (min-width: 992px) and (max-height: 700px) {
  .auth-visual { padding: 1.5rem 2.5rem; }
  .auth-visual__points li { padding: .55rem .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card, .wiz__step.is-in { animation: none; }
}

.wiz__h small { font-family: var(--font-sans); font-weight: 400; }
.auth-panel { border-radius: 0 !important; box-shadow: none !important; background: transparent !important; }

.wiz__consent { margin: 1rem 0 0; padding: .85rem .95rem; background: #fcf9f1; border: 1px solid var(--border-color); border-radius: 14px; }
.wiz__consent.has-error { border-color: #b42318; background: #fff8f7; }
.wiz__check { display: flex !important; gap: .7rem; align-items: flex-start; margin: 0 !important; font-weight: 500 !important; font-size: .84rem !important; line-height: 1.45; color: var(--ink) !important; cursor: pointer; }
.wiz__check input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--brand-green); }
.wiz__check a { color: var(--brand-green); font-weight: 700; }
.auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--brand-forest); }
.verify-legal { font-size: .78rem; color: var(--text-muted); }

.legal-points { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.legal-points li { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--ink); }
.legal-points i { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #f4ecdc; color: var(--brand-gold-text); }
