:root {
  color-scheme: light;
  --forest: #173f35;
  --forest-2: #245e4d;
  --cream: #fbf6ea;
  --paper: #fffdf7;
  --ink: #19352e;
  --muted: #61726b;
  --gold: #f2b94b;
  --coral: #e87958;
  --sage: #dceadf;
  --line: #d7e1d9;
  --danger: #a74437;
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); }
button, input, select { font: inherit; }
a { color: var(--forest-2); }
.hidden { display: none !important; }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3.5rem); color: white; background: var(--forest); }
.portal-brand { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; }
.auth-brand { margin-bottom: 1.5rem; color: var(--forest); }
.portal-brand img { width: 54px; height: 54px; object-fit: contain; border-radius: 50%; background: #fff7; }
.portal-brand strong { display: block; font-family: Georgia, serif; font-size: 1.4rem; }
.portal-brand span { color: #d7e7dd; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.header-links { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.header-links a, .header-links button { min-height: 42px; padding: .62rem .9rem; color: white; border: 1px solid #ffffff55; border-radius: 999px; background: transparent; text-decoration: none; cursor: pointer; }
.portal-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.eyebrow { margin: 0 0 .45rem; color: var(--coral); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.08; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); }
.muted { color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 16px 45px #173f3510; }
.trial-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; padding: 1rem 1.25rem; border-radius: 18px; background: var(--sage); }
.trial-banner strong { font-size: 1.05rem; }
.trial-banner.warning { background: #fff0cc; }
.dashboard-intro { display: grid; grid-template-columns: 1.5fr .8fr; gap: 1.25rem; align-items: stretch; margin-bottom: 1.5rem; }
.welcome-card { position: relative; overflow: hidden; padding: clamp(1.4rem, 4vw, 2.5rem); color: white; background: linear-gradient(135deg, var(--forest), #2e705c); }
.welcome-card::after { content: "W"; position: absolute; right: 2rem; bottom: -2.5rem; color: #ffffff12; font: 900 10rem Georgia, serif; }
.welcome-card p { max-width: 55ch; color: #e1eee7; }
.membership-card { padding: 1.4rem; }
.membership-card h2 { margin: .2rem 0 .7rem; }
.status-chip { display: inline-flex; align-items: center; min-height: 30px; padding: .3rem .68rem; border-radius: 999px; color: var(--forest); background: var(--sage); font-size: .78rem; font-weight: 800; text-transform: capitalize; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.section-heading h2 { margin: 0; }
.primary, .secondary, .danger { min-height: 46px; padding: .7rem 1rem; border-radius: 14px; font-weight: 800; cursor: pointer; }
.primary { color: white; border: 1px solid var(--forest); background: var(--forest); }
.secondary { color: var(--forest); border: 1px solid var(--line); background: white; }
.danger { color: var(--danger); border: 1px solid #e8c5bd; background: #fff7f4; }
.full-width { width: 100%; }
.block-link { display: block; text-align: center; text-decoration: none; }
.inline-link { display: inline-block; text-decoration: none; }
.fine-print { font-size: .86rem; }
.student-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.student-card { padding: 1.25rem; }
.student-card header { display: flex; align-items: start; justify-content: space-between; gap: .75rem; }
.student-card h3 { margin: 0; font-size: 1.4rem; }
.student-card .grade { padding: .3rem .65rem; border-radius: 999px; background: #fff0cc; font-weight: 800; }
.student-login-details { display: grid; gap: .18rem; margin: .9rem 0; padding: .8rem .9rem; border: 1px solid #c9dccc; border-radius: 14px; background: #eef6ef; }
.student-login-details span { color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.student-login-details strong { font: 800 1.08rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.student-login-details small { color: var(--muted); line-height: 1.35; }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin: 1rem 0; }
.metric { padding: .75rem; border-radius: 14px; background: #f2f6f2; }
.metric strong { display: block; font-size: 1.2rem; }
.metric span { color: var(--muted); font-size: .76rem; }
.card-actions { display: flex; gap: .55rem; flex-wrap: wrap; }
.card-actions button, .card-actions a { flex: 1; min-width: 96px; min-height: 42px; padding: .6rem .7rem; border-radius: 12px; text-align: center; text-decoration: none; }
.detail-panel { margin-top: 1.25rem; padding: clamp(1rem, 3vw, 1.6rem); }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .75rem; }
.overview-grid .metric { border: 1px solid var(--line); background: white; }
.performance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.performance-column { padding: 1rem; border-radius: 16px; background: #f3f6f3; }
.performance-column h4 { margin: 0 0 .7rem; }
.performance-column ul { margin: 0; padding-left: 1.1rem; }
.activity-list { display: grid; gap: .55rem; padding: 0; list-style: none; }
.activity-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; }
.account-field { padding: .85rem; border: 1px solid var(--line); border-radius: 14px; }
.account-field span { display: block; color: var(--muted); font-size: .76rem; }
.dev-controls { margin-top: 1.5rem; padding: 1.25rem; border: 2px dashed #d6a94c; border-radius: 18px; background: #fff9e9; }
.dev-controls .card-actions button { flex: 0 1 auto; }
dialog { width: min(540px, calc(100% - 1.5rem)); border: 0; border-radius: 24px; padding: 0; box-shadow: 0 24px 80px #142c2555; }
dialog::backdrop { background: #102c2477; }
.dialog-body { padding: 1.5rem; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; }
.close-button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #edf2ed; cursor: pointer; }
label { display: grid; gap: .35rem; margin-top: .85rem; font-weight: 750; }
input, select { min-height: 46px; padding: .7rem .8rem; border: 1px solid #afbeb4; border-radius: 12px; background: white; }
.consent-line { grid-template-columns: 22px 1fr; align-items: start; gap: .65rem; font-size: .88rem; line-height: 1.45; }
.consent-line input { width: 20px; min-height: 20px; margin: .15rem 0 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-status { min-height: 1.3rem; color: var(--danger); }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-story { position: relative; display: grid; align-content: center; overflow: hidden; padding: clamp(2rem, 6vw, 6rem); color: white; background: linear-gradient(145deg, #143d32, #2c6c58); }
.auth-story img { width: min(310px, 70%); margin: 2rem auto -2rem; filter: drop-shadow(0 20px 25px #0d251f55); }
.auth-story p { max-width: 52ch; color: #dcebe3; font-size: 1.08rem; }
.auth-panel { display: grid; align-content: center; padding: clamp(1.5rem, 6vw, 5rem); background: var(--paper); }
.auth-panel form { max-width: 480px; width: 100%; margin: 0 auto; }
.student-entry { margin: .9rem 0 0; }
.auth-switch { display: flex; gap: .5rem; margin-bottom: 1.3rem; padding: .35rem; border-radius: 14px; background: #edf2ed; }
.auth-switch button { flex: 1; min-height: 42px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.auth-switch button.active { background: white; box-shadow: 0 3px 12px #173f3518; }
.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.5rem 0; }
.plan { position: relative; padding: 1.5rem; }
.plan.recommended { border: 2px solid var(--gold); }
.plan-price { margin: .4rem 0; font: 700 2.2rem Georgia, serif; }
.plan ul { padding-left: 1.2rem; color: var(--muted); }
.billing-panel { margin: 1.5rem auto; padding: clamp(1.1rem, 4vw, 2rem); }
.billing-intro h2 { margin: .2rem 0 .5rem; }
.billing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 .85rem; }
.billing-grid .billing-wide { grid-column: 1 / -1; }
.billing-simulator-note { margin: 1rem 0 0; padding: .85rem 1rem; border-radius: 14px; color: #684d15; background: #fff4d7; font-size: .88rem; }
.billing-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.billing-actions button { flex: 1; min-width: 190px; }
.membership-hero { max-width: 850px; margin: 0 auto; text-align: center; }
.membership-hero > img { width: 150px; }
.notice { padding: .8rem 1rem; border-radius: 12px; background: #fff0cc; }
@media (max-width: 800px) {
  .dashboard-intro, .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 36vh; padding-bottom: 0; }
  body[data-mode="signup"] .auth-story { display: none; }
  body[data-mode="signup"] .auth-panel { min-height: 100vh; padding: 1.1rem; }
  .auth-story img { width: 150px; margin: .5rem auto -1rem; }
  .plans, .performance-grid, .billing-grid { grid-template-columns: 1fr; }
  .billing-grid .billing-wide { grid-column: auto; }
  .portal-header { align-items: flex-start; }
  .header-links { justify-content: flex-end; }
}
@media (max-width: 520px) {
  .portal-shell { width: min(100% - 1rem, 1180px); padding-top: 1rem; }
  .portal-brand span { display: none; }
  .portal-brand img { width: 44px; height: 44px; }
  .trial-banner, .section-heading { align-items: flex-start; flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

.auth-story .cloud-preview-note { color:#173f35; background:#fff1c7; border:1px solid #e1c477; padding:1rem; border-radius:1rem; font:600 .95rem/1.5 system-ui; }
