/* ============================================================
   EduShieldID — layouts/auth-shell.css
   Loaded by layouts/auth_base.html.
   Covers: auth-shell, auth-card, auth-form, auth-links,
           account-locked, 2FA, verify-email states.
   ============================================================ */

/* ── Auth shell — full-page centered layout ─────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-bg);
  padding: var(--sp-6);
}

/* ── Auth card ───────────────────────────────────────────────── */
.auth-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-10) var(--sp-8);
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

/* ── Logo link inside auth card ─────────────────────────────── */
.auth-logo {
  display: block;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--clr-primary);
  text-align: center;
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}
.auth-logo:hover { text-decoration: none; color: var(--clr-primary-dark); }

/* Signing in on a school's own subdomain: its mark and name, with the
   platform reduced to a line of small print underneath. The school is who
   the person signing in thinks they are signing in to. */
.auth-logo--tenant {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--clr-text);
}
.auth-tenant-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.auth-platform-note {
  margin: var(--space-1) 0 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}

/* ── Headings inside auth card ──────────────────────────────── */
.auth-card h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  text-align: center;
  color: var(--clr-text);
  margin-bottom: 0;
}

/* ── Auth form — stacks inputs vertically ───────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* A label and the input it names are one field, so they are grouped in the
   markup rather than being two siblings that the form's gap pushes apart. */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.auth-field label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
}

/* Excludes the types that keep their native chrome instead of naming the ones
   that don't — the old allow-list (email/password/text/hidden) silently
   dropped tel, number and date, which render as raw browser controls next to
   designed siblings. Radius is --radius-md to match .btn and .card: every
   other control rule in the platform now agrees on 8px. */
.auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="color"]):not([type="file"]),
.auth-form select {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--clr-border-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  /* Not the `background` shorthand: it resets background-image, and on the
     <select> in this same list that image is the dropdown arrow. */
  background-color: var(--clr-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}
.auth-form input::placeholder { color: var(--clr-text-muted); }

/* The arrow, appearance:none and cursor now come from the shared `select`
   rule in components/forms.css — this file only shifts the arrow out to match
   the wider sp-4 padding the auth fields use. The stroke colour moved with it
   from #6b7280 to the themed muted token, which is the value tokens.css
   settled on for contrast. */
.auth-form select {
  background-position: right var(--sp-4) center;
  padding-right: calc(var(--sp-4) + 10px + var(--sp-2));
}
.auth-form select:invalid { color: var(--clr-text-muted); }

.auth-hint {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  /* Sits tight under the field it annotates. Previously pulled up with a
     negative margin; a zero top margin plus the field's own spacing gives
     the same gap without one. */
  margin-top: 0;
}

.auth-terms-check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  padding: var(--sp-3);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-surface-alt, transparent);
  transition: border-color var(--transition, .15s ease), background var(--transition, .15s ease);
}

.auth-terms-check__text {
  display: inline;
  text-align: left;
}

.auth-terms-check:hover {
  border-color: var(--clr-primary);
}

.auth-terms-check:has(input:focus-visible) {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-light, rgba(37, 99, 235, .15));
}

.auth-terms-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm, 5px);
  background: var(--clr-surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background var(--transition, .15s ease), border-color var(--transition, .15s ease);
}

.auth-terms-check input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform var(--transition, .12s ease-out);
  box-shadow: inset 1em 1em var(--clr-on-primary, #fff);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.auth-terms-check input[type="checkbox"]:checked {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}

.auth-terms-check input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.auth-terms-check__link {
  display: inline;
  color: var(--clr-text);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-terms-check__link:hover {
  color: var(--clr-primary);
}

.auth-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Buttons inside auth form ───────────────────────────────── */
.auth-form .btn-primary {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-base);
  margin-top: var(--sp-2);
}

/* ── Links below / around form ──────────────────────────────── */
.auth-card > a,
.auth-card a:not(.auth-logo):not(.btn):not(.auth-terms-check__link) {
  display: block;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--clr-primary);
  margin-top: var(--sp-1);
}
.auth-card > a:hover { text-decoration: underline; }

.auth-link-muted {
  display: block;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--clr-text-muted) !important;
  margin-top: var(--sp-2);
}
.auth-link-muted:hover { color: var(--clr-text) !important; text-decoration: underline; }

/* ── Divider ────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--clr-text-muted);
  font-size: var(--text-xs);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--clr-border);
}

/* ── Status / info box inside auth card ─────────────────────── */
.auth-notice {
  background: var(--clr-info-bg);
  color: var(--clr-info);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  text-align: center;
}

/* ── account_locked.html ────────────────────────────────────── */
.auth-card .locked-icon {
  display: flex;
  justify-content: center;
  font-size: var(--text-4xl);
  margin-bottom: var(--sp-2);
}

/* ── two_factor.html — OTP input ────────────────────────────── */
.auth-form input[name="code"] {
  text-align: center;
  letter-spacing: .5em;
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
}

/* ── verify_email.html / email_verified.html ────────────────── */
.auth-card .email-status-icon {
  display: flex;
  justify-content: center;
  font-size: var(--text-5xl);
  margin-bottom: var(--sp-2);
}
.auth-card .email-status-body {
  text-align: center;
  color: var(--clr-text-muted);
  font-size: var(--text-sm);
}

/* ── change_password.html — password hint ───────────────────── */
.password-hint {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  /* Sits tight under the field it annotates. Previously pulled up with a
     negative margin; a zero top margin plus the field's own spacing gives
     the same gap without one. */
  margin-top: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: var(--sp-8) var(--sp-5); }
}

/* ── Responsive hardening ───────────────────────────────────── */
.auth-form input,
.auth-form select {
  max-width: 100%;
  width: 100%;
}

@media (max-width: 480px) {
  .auth-shell { padding: var(--sp-4); }
  .auth-form .btn { width: 100%; }
}
