:root {
  --bg: #f7fafd;
  --paper: rgba(255, 255, 255, 0.92);
  --line: rgba(12, 35, 68, 0.1);
  --ink: #0c2344;
  --muted: #64788e;
  --accent: #23436f;
  --accent-deep: #4d81c5;
  --teal: #6e9ad2;
  --shadow: 0 20px 48px rgba(12, 35, 68, 0.1);
  --error-bg: #f2f6fb;
  --error-border: rgba(12, 35, 68, 0.18);
  --error-text: #0b3f86;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(77, 129, 197, 0.11), transparent 22%),
    radial-gradient(circle at bottom right, rgba(35, 67, 111, 0.09), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, #f7fafd 54%, #e4edf7 100%);
  color: var(--ink);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: min(580px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: rgba(12, 35, 68, 0.62);
  font-weight: 800;
}

.auth-card h1 {
  margin: 0 0 0.45rem;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.muted {
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.45rem;
}

.auth-field span {
  color: #4f6278;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-field input {
  height: 52px;
  border: 1px solid rgba(24, 48, 71, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 0 0.95rem;
  color: var(--ink);
  font: inherit;
}

.auth-field input:focus {
  outline: 2px solid rgba(93, 141, 203, 0.18);
  border-color: rgba(93, 141, 203, 0.34);
}

.auth-btn {
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, #5d8dcb 100%);
  color: #f7fbff;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 12px 20px rgba(35, 67, 111, 0.16);
  cursor: pointer;
}

.auth-btn:hover {
  background: linear-gradient(135deg, #2f507d 0%, #6f9bd4 100%);
}

.auth-error {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--error-border);
  border-radius: 14px;
  background: var(--error-bg);
  color: var(--error-text);
  font-weight: 700;
}

.auth-success { border-color: #8acbb5; background: rgba(48, 147, 107, .1); color: #17664b; }
:root[data-theme="dark"] .auth-success { border-color: #398c72; background: #173b33; color: #c4f8de; }
.auth-btn:disabled { opacity: .65; cursor: wait; }

.auth-links {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.auth-links a {
  color: var(--navy, #183047);
  text-decoration: none;
  font-weight: 800;
}

.hidden { display: none !important; }

/* Shared account experience */
.auth-topbar { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 22px 0 4px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.auth-brand img { display: block; width: 42px; height: 42px; object-fit: contain; border-radius: 12px; background: #fff; padding: 3px; box-shadow: 0 5px 16px rgba(12,35,68,.12); }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: .85rem; letter-spacing: .05em; }
.auth-brand small { color: var(--muted); font-size: .68rem; }
.auth-shell { width: min(1200px, 100%); min-height: calc(100vh - 80px); margin: 0 auto; grid-template-columns: minmax(0,1.05fr) minmax(390px,.95fr); gap: clamp(18px,3vw,36px); padding: 24px; align-items: stretch; justify-items: stretch; }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 640px; overflow: hidden; isolation: isolate; border: 1px solid rgba(170,208,237,.25); border-radius: 28px; padding: clamp(24px,3vw,42px); background: #102a46; color: #fff; box-shadow: 0 20px 48px rgba(12,35,68,.16); }
.auth-story::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url('/imgs/student-studying-visitor-counter.jpg') center / cover no-repeat; }
.auth-story::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg,rgba(8,29,54,.65),rgba(8,29,54,.1) 37%,rgba(8,29,54,.96) 100%); }
.auth-story-top { display: flex; align-items: center; gap: 12px; color: #e0f3ff; font-size: .76rem; font-weight: 800; letter-spacing: .04em; }
.auth-story-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.48); border-radius: 12px; background: rgba(255,255,255,.16); color: #fff; font-size: .9rem; letter-spacing: -.08em; }
.auth-story-copy { max-width: 520px; }
.auth-story-kicker { margin: 0 0 10px; color: #a7e6ee; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.auth-story h2 { margin: 0 0 14px; font: 600 clamp(2.4rem,4vw,4.2rem)/1.02 "Iowan Old Style","Palatino Linotype",serif; letter-spacing: -.045em; }
.auth-story-copy > p:not(.auth-story-kicker) { max-width: 44ch; color: #e1f1fc; font-size: 1rem; line-height: 1.6; }
.auth-story-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.auth-story-pills span { padding: 7px 11px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; background: rgba(255,255,255,.11); color: #f3fbff; font-size: .72rem; font-weight: 700; }
.auth-card { align-self: center; width: 100%; max-width: 560px; padding: clamp(28px,3.5vw,52px); border-radius: 28px; background: #fff; box-shadow: 0 24px 60px rgba(12,35,68,.13); }
.auth-card h1 { font-family: Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; font-size: clamp(2.2rem,3.2vw,3.5rem); font-weight: 800; line-height: 1.06; letter-spacing: -.055em; }
.auth-card .muted { margin: 0; max-width: 48ch; font-size: .94rem; line-height: 1.6; }
.auth-form { gap: 1.05rem; margin-top: 1.7rem; }
.auth-field { gap: .45rem; }
.auth-field span { color: #31465f; font-size: .76rem; letter-spacing: .04em; text-transform: none; }
.auth-field input { height: 54px; border: 1px solid #cbd8e6; border-radius: 12px; background: #fbfdff; font-size: .96rem; }
.auth-field input:focus-visible { outline: 3px solid rgba(57,137,209,.22); outline-offset: 1px; border-color: #438bc9; }
.auth-hint { color: #61778d; font-size: .75rem; }
.auth-btn { height: 54px; border-radius: 12px; margin-top: .2rem; }
.auth-links { align-items: center; justify-content: space-between; padding-top: .95rem; border-top: 1px solid #e2eaf2; }
.auth-links a { color: #1e5f9b; font-size: .83rem; }
.auth-links a:hover { text-decoration: underline; }
.auth-shell-compact { display: grid; grid-template-columns: 1fr; width: min(900px,100%); min-height: 100vh; }
.auth-shell-compact .auth-card { max-width: 620px; }
:root[data-theme="dark"] .auth-card { background: #142338; border-color: #344d67; box-shadow: 0 24px 60px rgba(0,0,0,.27); }
:root[data-theme="dark"] .auth-brand { color: #eef6ff; }
:root[data-theme="dark"] .auth-brand small { color: #b8cbdd; }
:root[data-theme="dark"] .auth-field span { color: #d4e3f2; }
:root[data-theme="dark"] .auth-field input { background: #102035; border-color: #4c647d; color: #f1f7ff; }
:root[data-theme="dark"] .auth-hint { color: #aec2d5; }
:root[data-theme="dark"] .auth-links { border-color: #354960; }
:root[data-theme="dark"] .auth-links a { color: #a5d2ff; }
@media (max-width: 880px) { .auth-shell { grid-template-columns: 1fr; min-height: 0; padding-top: 16px; } .auth-story { min-height: 250px; } .auth-story h2 { max-width: 18ch; font-size: clamp(2rem,5vw,3rem); } .auth-story-copy > p:not(.auth-story-kicker), .auth-story-pills { display: none; } .auth-card { max-width: none; } }
@media (max-width: 560px) { .auth-topbar { width: calc(100% - 28px); padding-top: 14px; } .auth-shell { padding: 14px; gap: 14px; } .auth-story { min-height: 180px; padding: 20px; border-radius: 20px; } .auth-story-top { font-size: .68rem; } .auth-story h2 { font-size: 2rem; } .auth-card { padding: 26px 22px; border-radius: 20px; } .auth-links { gap: .8rem; justify-content: flex-start; } }
