/* Public pages: landing, role selection, sign in / sign up. Loaded after styles.css, only on index.html and auth.html.
   Mostly white, soft colour, rounded cards. Uses the shared tokens, so dark mode and role colours keep working. */
body.public { background: #fff; background-image: radial-gradient(900px 520px at 85% -10%, #eef0ff 0%, transparent 60%), radial-gradient(700px 480px at -5% 8%, #e6f7f1 0%, transparent 55%), radial-gradient(800px 500px at 50% 120%, #fff3e8 0%, transparent 60%); }
[data-theme="dark"] body.public { background: var(--bg); }

.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3rem); max-width: 1180px; margin: 0 auto; }
.pub-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.btn.pill, .pub-head .btn, .pub-main .btn.round { border-radius: 999px; }
.btn.lg { padding: .8rem 1.5rem; font-size: 1.02rem; }

/* ---------- landing ---------- */
.pub-main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem) 3rem; }
.l-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2.5rem; align-items: center; padding: clamp(1.5rem, 6vw, 4.5rem) 0 2.5rem; }
.l-eyebrow { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .8rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: .82rem; }
.l-hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.7rem); line-height: 1.08; letter-spacing: -.03em; margin-top: 1rem; }
.l-hero h1 span { background: linear-gradient(100deg, #4f46e5, #0a8f6a 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.l-hero p.lead { margin-top: 1.1rem; font-size: 1.12rem; color: var(--ink-2); max-width: 52ch; }
.l-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.7rem; }
.l-note { margin-top: 1rem; font-size: .88rem; color: var(--ink-3); }
.l-visual { position: relative; min-height: 400px; }
.l-card { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 50px rgba(79, 70, 229, .12); padding: 1.1rem 1.2rem; }
.l-card b { display: block; }
.l-card .dot { width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; margin-bottom: .6rem; }
.l-c1 { top: 0; left: 0; width: 64%; } .l-c1 .dot { background: #eceafe; color: #4f46e5; }
.l-c2 { top: 135px; right: 0; width: 62%; } .l-c2 .dot { background: #dff5ec; color: #0a8f6a; }
.l-c3 { top: 275px; left: 6%; width: 62%; } .l-c3 .dot { background: #ffe8da; color: #c2410c; }
.l-bar { height: 8px; border-radius: 99px; background: var(--line); margin-top: .7rem; overflow: hidden; } .l-bar i { display: block; height: 100%; width: 78%; border-radius: 99px; background: linear-gradient(90deg, #4f46e5, #0a8f6a); }
.l-section { padding: 2.5rem 0 0; }
.l-section > h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; text-align: center; }
.l-section > p.sub { text-align: center; color: var(--ink-2); max-width: 56ch; margin: .6rem auto 0; }
.l-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 1.1rem; margin-top: 1.8rem; }
.l-feature { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.3rem; box-shadow: var(--shadow); }
.l-feature .dot { width: 2.8rem; height: 2.8rem; border-radius: 14px; display: grid; place-items: center; margin-bottom: .8rem; }
.l-feature h3 { margin-bottom: .3rem; } .l-feature p { color: var(--ink-2); font-size: .94rem; }
.tone-a .dot { background: #eceafe; color: #4f46e5; } .tone-b .dot { background: #dff5ec; color: #0a8f6a; } .tone-c .dot { background: #ffe8da; color: #c2410c; } .tone-d .dot { background: #e3eefc; color: #1d63c9; }
.l-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 1rem; margin-top: 1.8rem; padding: 0; counter-reset: s; list-style: none; }
.l-steps li { position: relative; padding: 1rem 1rem 1rem 3.4rem; border-radius: 18px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); }
.l-steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 1rem; top: 1rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .85rem; }
.l-final { margin-top: 3rem; text-align: center; padding: 2.2rem 1.2rem; border-radius: 28px; background: linear-gradient(120deg, #eceafe, #dff5ec 60%, #fff0e4); }
[data-theme="dark"] .l-final { background: var(--surface); border: 1px solid var(--line); }
.l-final h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); } .l-final .l-cta { justify-content: center; }
.pub-foot { text-align: center; color: var(--ink-3); font-size: .85rem; padding: 1.5rem 1rem 2.5rem; }
@media (max-width: 860px) { .l-hero { grid-template-columns: 1fr; } .l-visual { min-height: 400px; max-width: 460px; width: 100%; margin: 0 auto; } }

/* ---------- role chooser (Sign in / Sign up) ---------- */
.choose { max-width: 880px; margin: 0 auto; padding: clamp(1rem, 4vw, 2.5rem) 0 2rem; text-align: center; }
.choose h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); letter-spacing: -.02em; }
.choose p.sub { color: var(--ink-2); margin-top: .6rem; }
.choose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin-top: 2rem; text-align: left; }
.choose-card { display: flex; flex-direction: column; gap: .8rem; padding: 1.6rem; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
.choose-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 22%, transparent); }
.choose-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--accent-soft); z-index: 0; }
.choose-card > * { position: relative; z-index: 1; }
.choose-card .glyph { width: 3.4rem; height: 3.4rem; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.choose-card .glyph .icon { width: 1.7rem; height: 1.7rem; }
.choose-card h2 { font-size: 1.5rem; } .choose-card p { color: var(--ink-2); }
.choose-card .go { margin-top: .4rem; display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--accent-strong); }
.choose-card[data-role="student"] { --accent: #0b78c4; --accent-strong: #075e9c; --accent-soft: #e1f1fb; --on-accent: #fff; }
.choose-card[data-role="teacher"] { --accent: #0a8f6a; --accent-strong: #06704f; --accent-soft: #dff5ec; --on-accent: #fff; }
[data-theme="dark"] .choose-card[data-role="student"] { --accent: #5cb8f2; --accent-strong: #8dd0f8; --accent-soft: #0f2a3d; --on-accent: #06202f; }
[data-theme="dark"] .choose-card[data-role="teacher"] { --accent: #34d399; --accent-strong: #6ee7b7; --accent-soft: #11332a; --on-accent: #06251b; }
.admin-link { display: inline-flex; align-items: center; gap: .45rem; }
@media (max-width: 640px) { .choose-grid { grid-template-columns: 1fr; } }

/* ---------- sign in / sign up card (split layout) ---------- */
.auth-wrap { min-height: calc(100vh - 5rem); }
.auth-split { width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); border-radius: 28px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(22, 26, 43, .12); }
.auth-split.wide { width: min(1040px, 100%); }
.auth-side { padding: 2.2rem 2rem; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; background: linear-gradient(150deg, #0b78c4, #0a95c0 58%, #0aa5b8); position: relative; overflow: hidden; }
.auth-side[data-role="teacher"] { background: linear-gradient(150deg, #0a8f6a, #12a67e 58%, #2bb88f); }
.auth-side[data-role="admin"] { background: linear-gradient(150deg, #d9560f, #ea6c1c 58%, #f59a3b); }
.auth-side::after { content: ""; position: absolute; right: -70px; bottom: -70px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.auth-side h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; color: #fff; }
.auth-side p { color: rgba(255, 255, 255, .88); margin-top: .7rem; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; position: relative; z-index: 1; }
.auth-side li { display: flex; gap: .6rem; align-items: center; background: rgba(255, 255, 255, .14); padding: .55rem .8rem; border-radius: 14px; font-size: .92rem; }
.auth-side .tag { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .2); font-weight: 700; font-size: .8rem; width: fit-content; }
.auth-main { display: flex; flex-direction: column; }
.auth-main .auth-body { padding: 1.8rem 2rem 1.2rem; flex: 1; align-content: start; }
.auth-main h1 { font-size: 1.7rem; letter-spacing: -.02em; } .auth-main .sub { color: var(--ink-2); margin-top: .3rem; }
.auth-main .auth-foot { background: transparent; }
.auth-top { padding: 1.1rem 2rem 0; }
@media (max-width: 760px) {
  .auth-split, .auth-split.wide { grid-template-columns: 1fr; border-radius: 22px; }
  .auth-side { padding: 1.3rem 1.3rem; } .auth-side ul { display: none; }
  .auth-main .auth-body { padding: 1.3rem 1.3rem .8rem; } .auth-top { padding: 1rem 1.3rem 0; } .auth-foot { padding: 1rem 1.3rem; }
}
@media (max-width: 480px) { .pub-head { padding: .8rem 1rem; } .pub-head .brand { font-size: 1rem; } .l-cta .btn { flex: 1; } }
.choose p.small { margin-top: 1.4rem; }
.auth-side .tag + h2 { margin-top: .9rem; }

/* ---------- admin strip on the role page ---------- */
.admin-strip { display: flex; align-items: center; gap: 1rem; margin: 1.6rem auto 0; max-width: 100%; padding: .9rem 1.2rem; border-radius: 20px; border: 1px solid #fcd9c2; background: linear-gradient(100deg, #fff4ec, #ffe8d6); color: #7c2d0a; text-align: left; transition: transform .2s, box-shadow .2s; }
.admin-strip:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(234, 108, 28, .6); }
.admin-strip .glyph { width: 2.6rem; height: 2.6rem; border-radius: 14px; display: grid; place-items: center; background: #ea6c1c; color: #fff; flex: none; transition: transform .25s; } .admin-strip:hover .glyph { transform: rotate(-8deg) scale(1.08); }
.admin-strip b { display: block; color: #9a3412; } .admin-strip small { color: #9a5a35; } .admin-strip .arrow { margin-left: auto; color: #c2410c; transition: transform .2s; } .admin-strip:hover .arrow { transform: translateX(4px); }
[data-theme="dark"] .admin-strip { background: var(--surface); border-color: var(--line); color: var(--ink); } [data-theme="dark"] .admin-strip b { color: #ff9556; }

/* ---------- landing: motion ---------- */
@keyframes l-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes l-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes l-drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -20px) scale(1.08); } }
@keyframes l-fill { from { width: 0; } to { width: 78%; } }
.l-hero > div:first-child > * { animation: l-rise .7s both; } .l-hero > div:first-child > *:nth-child(2) { animation-delay: .08s; } .l-hero > div:first-child > *:nth-child(3) { animation-delay: .16s; } .l-hero > div:first-child > *:nth-child(4) { animation-delay: .24s; } .l-hero > div:first-child > *:nth-child(5) { animation-delay: .32s; }
.l-card { animation: l-rise .8s both, l-float 6s ease-in-out infinite; transition: box-shadow .25s; } .l-c1 { animation-delay: .2s, 0s; } .l-c2 { animation-delay: .35s, 1.2s; } .l-c3 { animation-delay: .5s, 2.4s; }
.l-card:hover { box-shadow: 0 26px 60px rgba(11, 120, 196, .25); z-index: 3; }
.l-bar i { animation: l-fill 1.6s .9s both ease-out; }
.pub-main::before { content: ""; position: fixed; width: 420px; height: 420px; left: -120px; top: 40%; border-radius: 50%; background: radial-gradient(circle, rgba(10, 143, 106, .12), transparent 65%); animation: l-drift 14s ease-in-out infinite; pointer-events: none; z-index: -1; }
.l-feature { transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s; animation: l-rise .7s both; } .l-grid .l-feature:nth-child(2) { animation-delay: .08s; } .l-grid .l-feature:nth-child(3) { animation-delay: .16s; } .l-grid .l-feature:nth-child(4) { animation-delay: .24s; }
.l-feature:hover { transform: translateY(-8px); box-shadow: 0 22px 44px -18px rgba(11, 120, 196, .4); border-color: #b9dcf3; }
.l-feature .dot { transition: transform .3s, background .3s, color .3s; } .l-feature:hover .dot { transform: rotate(-8deg) scale(1.12); }
.l-steps li { transition: transform .2s, box-shadow .2s, border-color .2s; } .l-steps li:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -16px rgba(11, 120, 196, .45); border-color: #b9dcf3; }
.pub-head .btn, .l-cta .btn, .l-final .btn { transition: transform .2s, box-shadow .2s, background .2s; } .pub-head .btn:hover, .l-cta .btn:hover, .l-final .btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(11, 120, 196, .6); }
.btn.primary { position: relative; overflow: hidden; } .pub-main .btn.primary::after, .pub-head .btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s; } .pub-main .btn.primary:hover::after, .pub-head .btn.primary:hover::after { transform: translateX(120%); }
.choose-card { animation: l-rise .6s both; } .choose-card:nth-child(2) { animation-delay: .1s; }
.choose-card:hover .glyph { transform: rotate(-8deg) scale(1.1); } .choose-card .glyph { transition: transform .25s; } .choose-card:hover .go { gap: .8rem; } .choose-card .go { transition: gap .2s; }
@media (prefers-reduced-motion: reduce) { .l-hero > div:first-child > *, .l-card, .l-feature, .choose-card, .pub-main::before, .l-bar i { animation: none !important; } }
.l-hero h1 span { background: linear-gradient(100deg, #0b78c4, #0a8f6a 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.l-eyebrow, .l-steps li::before { background-color: #e1f1fb; } .l-eyebrow { color: #075e9c; } .l-steps li::before { background: #0b78c4; color: #fff; }
.l-c1 .dot { background: #e1f1fb; color: #0b78c4; }
.l-bar i { background: linear-gradient(90deg, #0b78c4, #0a8f6a); }
.pub-main .btn.primary, .pub-head .btn.primary { background: #0b78c4; border-color: #0b78c4; }
/* The sign-in pages don't load student.css, so give the student its blue here (same values). */
[data-role="student"] { --accent: #0b78c4; --accent-strong: #075e9c; --accent-soft: #e1f1fb; --on-accent: #ffffff; }
[data-theme="dark"] [data-role="student"] { --accent: #5cb8f2; --accent-strong: #8dd0f8; --accent-soft: #0f2a3d; --on-accent: #06202f; }

/* Landing / sign-in header on phones: icon-only Appearance button, and brand, Appearance, Sign in and Sign up all on one line */
@media (max-width: 560px) {
  .pub-head { flex-wrap: nowrap; gap: .5rem; padding: .7rem .8rem; }
  .pub-head .brand { font-size: .98rem; gap: .4rem; flex: 0 1 auto; min-width: 0; white-space: nowrap; } .pub-head .logo-img { width: 1.9rem; height: 1.9rem; }
  .pub-actions { flex-wrap: nowrap; gap: .35rem; flex: none; }
  .pub-actions .btn { padding: .5rem .8rem; font-size: .88rem; white-space: nowrap; }
  .pub-actions .theme-wrap .btn { padding: .5rem .6rem; }
}
@media (max-width: 370px) { .pub-head .brand span:not(.mark) { display: none; } }