:root{
  --c-primary:#03565C;
  --c-accent:#009489;
  --c-mint:#CCFBF1;
  --c-bg:#F3FDFB;
  --c-surface:#FFFFFF;
  --c-surface-2:#F8FAFC;
  --c-text:#0f172a;
  --c-muted:#475569;
  --c-border:rgba(2, 6, 23, .10);
  --shadow:0 10px 25px rgba(2, 6, 23, .08);
  --radius:8px;
  --radius-sm:8px;
  --max:1100px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
  font-size:14px;
  background:linear-gradient(180deg,var(--c-bg),#fff);
  background-repeat: no-repeat;
  color:var(--c-text);
}

a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}

.container{width:100%;max-width:var(--max);margin:0 auto;padding:20px}

.topbar{
  position:sticky;top:0;z-index:10;
  background:rgba(255,255,255,.78);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--c-border);
}
.topbar__inner{display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.2px}
.brand__dot{width:10px;height:10px;border-radius:999px;background:var(--c-accent);box-shadow:0 0 0 6px rgba(0,148,137,.10)}
.nav-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

.overlay{display:none}

@media (max-width: 959px){
  [data-landing-menu-open]{display:inline-flex}
  .topbar__inner{position:relative}
  [data-landing-menu]{
    position:absolute;right:20px;top:64px;
    display:none;
    flex-direction:column;
    gap:10px;
    padding:12px;
    background:rgba(255,255,255,.96);
    border:1px solid var(--c-border);
    border-radius:12px;
    box-shadow:0 18px 40px rgba(2,6,23,.12);
    z-index:20;
    min-width:220px;
  }
  [data-landing-menu].is-open{display:flex}
  [data-landing-overlay]{
    display:none;
    position:fixed;inset:0;
    background:rgba(2,6,23,.25);
    z-index:15;
  }
  [data-landing-overlay].is-visible{display:block}

  [data-landing-menu] [data-landing-primary]{
    background:rgba(0,148,137,.10);
    border-color:rgba(0,148,137,.22);
    color:var(--c-primary);
  }
  [data-landing-menu] [data-landing-primary]:hover{
    background:rgba(0,148,137,.14);
  }
}

@media (min-width: 960px){
  [data-landing-menu-open]{display:none}
  [data-landing-overlay]{display:none !important}
}

.btn{
  appearance:none;border:1px solid var(--c-border);background:var(--c-surface);
  color:var(--c-text);
  padding:10px 14px;border-radius:8px;
  box-shadow:0 1px 0 rgba(2,6,23,.03);
  cursor:pointer;
}
.btn:disabled{
  opacity:.65;
  cursor:not-allowed;
}
.btn:disabled:hover{
  background:inherit;
}
.btn:focus{outline:2px solid rgba(0,148,137,.35);outline-offset:2px}
.btn--primary{background:var(--c-primary);border-color:rgba(3,86,92,.65);color:#fff}
.btn--accent{background:var(--c-accent);border-color:rgba(0,148,137,.7);color:#fff}
.btn--ghost{background:transparent}
.btn--sm{padding:8px 12px;font-size:14px}

.hero{padding:34px 0 26px}
.hero__grid{display:grid;grid-template-columns:1fr;gap:18px;align-items:center}
.hero__card{
  background:var(--c-surface);
  border:1px solid var(--c-border);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow);
}
.hero__title{margin:0;font-size:30px;line-height:1.12;letter-spacing:-.5px}
.hero__subtitle{margin:10px 0 0;color:var(--c-muted);line-height:1.55}
.pill-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.pill{
  display:inline-flex;gap:8px;align-items:center;
  padding:8px 10px;border-radius:999px;
  background:rgba(204,251,241,.6);
  border:1px solid rgba(0,148,137,.18);
  color:var(--c-primary);font-weight:700;font-size:14px;
}
.pill__dot{width:8px;height:8px;border-radius:999px;background:var(--c-accent)}

.grid{display:grid;grid-template-columns:1fr;gap:14px}
.card{
  background:var(--c-surface);
  border:1px solid var(--c-border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:0 10px 25px rgba(2, 6, 23, .05);
}
.card__title{margin:0 0 8px;font-size:16px;letter-spacing:-.2px}
.card__text{margin:0;color:var(--c-muted);line-height:1.55}
.paywall{position:relative;overflow:hidden}
.paywall__blur{filter:blur(7px);opacity:.85;pointer-events:none}
.paywall__cta{
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;flex-direction:column;
  padding:18px;text-align:center;
  background:rgba(255,255,255,.78);
  border:1px solid var(--c-border);
  border-radius:var(--radius);
  backdrop-filter:saturate(180%) blur(12px);
}
.chart{
  width:100%;
  height:260px;
  display:block;
  border-radius:8px;
  border:1px solid var(--c-border);
  background:var(--c-surface);
}

.auth{
  min-height:calc(100vh - 74px);
  display:flex;align-items:flex-start;
  padding:22px 0 36px;
}
.auth-card{
  width:100%;
  max-width:520px;
  margin:0 auto;
  background:var(--c-surface);
  border:1px solid var(--c-border);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow);
}
.auth-title{margin:0 0 6px;font-size:22px;letter-spacing:-.3px}
.auth-subtitle{margin:0 0 14px;color:var(--c-muted)}
.form{display:grid;gap:12px}
.field{display:grid;gap:6px}
.label{font-weight:600;font-size:14px}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:8px;
  border:1px solid var(--c-border);
  background:var(--c-surface-2);
  color:var(--c-text);
}
.input:focus{outline:2px solid rgba(0,148,137,.30);outline-offset:2px}
.help{color:var(--c-muted);font-size:13px;line-height:1.4}
.row{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.chk{display:flex;align-items:center;gap:10px;color:var(--c-muted);font-weight:700}
.toggle{display:inline-flex;align-items:center;gap:10px;color:var(--c-muted);font-weight:700;cursor:pointer;user-select:none}
.toggle input{position:absolute;opacity:0;pointer-events:none}
.toggle__ui{
  position:relative;
  width:44px;height:26px;
  border-radius:999px;
  background:rgba(2,6,23,.10);
  border:1px solid var(--c-border);
  transition:background .15s ease,border-color .15s ease;
  box-shadow:inset 0 1px 0 rgba(2,6,23,.06);
  flex:0 0 auto;
}
.toggle__ui::after{
  content:"";
  position:absolute;top:50%;left:3px;
  width:20px;height:20px;border-radius:999px;
  background:var(--c-surface);
  border:1px solid var(--c-border);
  transform:translateY(-50%);
  transition:transform .15s ease;
  box-shadow:0 8px 18px rgba(2,6,23,.12);
}
.toggle input:checked + .toggle__ui{
  background:rgba(0,148,137,.85);
  border-color:rgba(0,148,137,.45);
}
.toggle input:checked + .toggle__ui::after{
  transform:translate(18px,-50%);
}
.toggle input:focus-visible + .toggle__ui{
  outline:2px solid rgba(0,148,137,.35);
  outline-offset:2px;
}
.alert{
  border-radius:8px;
  padding:10px 12px;
  border:1px solid rgba(3,86,92,.18);
  background:rgba(204,251,241,.45);
  color:var(--c-primary);
  display:none;
}
.alert--error{
  border-color:rgba(220,38,38,.22);
  background:rgba(254,242,242,.85);
  color:#991b1b;
}
.alert.is-visible{display:block}

.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr;
}
.sidebar{
  position:fixed;inset:0 auto 0 0;
  width:280px;
  background:rgba(255,255,255,.92);
  border-right:1px solid var(--c-border);
  backdrop-filter:saturate(160%) blur(10px);
  transform:translateX(-105%);
  transition:transform .18s ease;
  z-index:50;
  padding:16px;
}
.sidebar.is-open{transform:translateX(0)}
.sidebar__header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.sidebar__user{
  display:grid;gap:2px;margin-top:12px;
  padding:12px;border-radius:var(--radius-sm);
  background:rgba(204,251,241,.35);
  border:1px solid rgba(0,148,137,.18);
}
.sidebar__user strong{font-size:14px}
.sidebar__user span{font-size:13px;color:var(--c-muted);font-weight:700}
.menu{display:grid;gap:6px;margin-top:12px}
.menu a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;border-radius:8px;
  border:1px solid transparent;
  font-weight:500;color:var(--c-text);
}
.menu__icon{
  width:18px;
  height:18px;
  color:var(--c-primary);
  opacity:.9;
  flex:0 0 auto;
}
.menu a:hover{background:rgba(3,86,92,.06);border-color:rgba(3,86,92,.12)}
.menu a.is-active{background:rgba(0,148,137,.10);border-color:rgba(0,148,137,.20);color:var(--c-primary)}
.appbar{
  position:sticky;top:0;z-index:20;
  background:rgba(255,255,255,.78);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--c-border);
}
.appbar__inner{display:flex;align-items:center;justify-content:space-between;gap:10px}
.content{padding:18px}
.content .container{padding:0 20px}
.app-footer{
  margin-top:18px;
  padding:14px 0 10px;
  text-align:center;
  color:var(--c-muted);
  font-size:12px;
  border-top:1px solid var(--c-border);
  opacity:.75;
}

.table{
  width:100%;
  border-collapse:collapse;
  border:1px solid var(--c-border);
  background:var(--c-surface);
  border-radius:var(--radius);
  overflow:hidden;
}
.table th,.table td{
  text-align:left;
  padding:12px;
  border-bottom:1px solid var(--c-border);
  vertical-align:top;
}
.table th{
  font-size:13px;
  letter-spacing:.2px;
  color:var(--c-muted);
  background:rgba(248,250,252,.9);
}
.table tr:last-child td{border-bottom:none}

.opt-list{display:grid;gap:10px}
.opt{
  position:relative;
  display:block;
  cursor:pointer;
}
.opt input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.opt__text{
  display:block;
  width:100%;
  padding:12px;
  border-radius:8px;
  border:1px solid var(--c-border);
  background:var(--c-surface-2);
  line-height:1.45;
}
.opt input:focus-visible + .opt__text{
  outline:2px solid rgba(0,148,137,.30);
  outline-offset:2px;
}
.opt input:checked + .opt__text{
  background:rgba(0,148,137,.10);
  border-color:rgba(0,148,137,.30);
}
.opt--correct .opt__text{background:rgba(204,251,241,.55);border-color:rgba(0,148,137,.22)}
.opt--wrong .opt__text{background:rgba(254,242,242,.85);border-color:rgba(220,38,38,.22)}
.opt--selected .opt__text{background:rgba(2,6,23,.03)}
.opt[aria-disabled="true"]{cursor:default}

.countdown{
  position:sticky;
  top:12px;
  z-index:30;
  display:flex;
  justify-content:flex-end;
  margin:10px 0 0;
}
.countdown__pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.86);
  border:1px solid var(--c-border);
  backdrop-filter:saturate(180%) blur(12px);
  font-weight:900;
  color:var(--c-primary);
  box-shadow:0 10px 25px rgba(2, 6, 23, .08);
}
.countdown__pill.is-expired{
  color:#991b1b;
  border-color:rgba(220,38,38,.22);
  background:rgba(254,242,242,.90);
}

.flashcards{
  display:grid;
  gap:14px;
}
.flashcard{
  position:relative;
  border:1px solid var(--c-border);
  border-radius:var(--radius);
  background:var(--c-surface);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.flashcard__front,.flashcard__back{
  padding:16px;
}
.flashcard__back{
  display:none;
  border-top:1px solid var(--c-border);
  background:rgba(204,251,241,.22);
}
.flashcard.is-revealed .flashcard__back{display:block}
.flashcard__meta{
  font-size:12px;
  font-weight:900;
  letter-spacing:.2px;
  color:var(--c-muted);
}
.flashcard__question{
  margin-top:8px;
  line-height:1.45;
  white-space:pre-wrap;
}
.flashcard__img{
  width:100%;
  max-width:780px;
  margin-top:12px;
  border-radius:8px;
  border:1px solid var(--c-border);
  background:var(--c-surface-2);
  display:block;
}
.flashcard__options{
  display:grid;
  gap:10px;
  margin-top:12px;
}
.flashcard__opt{
  padding:12px;
  border-radius:8px;
  border:1px solid var(--c-border);
  background:var(--c-surface-2);
  line-height:1.45;
  cursor:pointer;
  text-align:left;
}
.flashcard__opt:focus{outline:2px solid rgba(0,148,137,.30);outline-offset:2px}
.flashcard__opt.is-selected{
  background:rgba(0,148,137,.10);
  border-color:rgba(0,148,137,.30);
}
.flashcard__opt.is-correct{
  background:rgba(204,251,241,.55);
  border-color:rgba(0,148,137,.22);
}
.flashcard__opt.is-wrong{
  background:rgba(254,242,242,.85);
  border-color:rgba(220,38,38,.22);
}
.flashcard__answer{
  margin-top:8px;
  font-weight:900;
  color:var(--c-primary);
  line-height:1.45;
  white-space:pre-wrap;
}
.flashcard__exp{
  margin-top:6px;
  color:var(--c-muted);
  line-height:1.55;
  white-space:pre-wrap;
}

.support-grid{
  display:grid;
  gap:14px;
  grid-template-columns:1fr;
}
.support-list{
  display:grid;
  gap:10px;
}
.support-item{
  border:1px solid var(--c-border);
  border-radius:8px;
  background:var(--c-surface-2);
  padding:12px;
}
.support-item__subject{
  font-weight:900;
  color:var(--c-text);
}
.support-item__meta{
  margin-top:4px;
  font-size:12px;
  color:var(--c-muted);
  font-weight:700;
}
.support-item__body{
  margin-top:6px;
  color:var(--c-muted);
  line-height:1.45;
}

.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--c-border);
  font-size:12px;
  color:var(--c-muted);
  background:rgba(2,6,23,.03);
}
.badge--success{
  color:var(--c-primary);
  background:rgba(204,251,241,.55);
  border-color:rgba(0,148,137,.22);
}
.badge--open{
  color:#0f172a;
  background:rgba(255,255,255,.9);
  border-color:rgba(2,6,23,.10);
}

.support-admin-grid{
  display:grid;
  gap:14px;
  grid-template-columns:1fr;
}
.inbox-list{
  display:grid;
  gap:8px;
}
.inbox-item{
  width:100%;
  text-align:left;
  border:1px solid var(--c-border);
  border-radius:8px;
  background:var(--c-surface-2);
  padding:10px;
  cursor:pointer;
}
.inbox-item.is-active{
  background:rgba(0,148,137,.10);
  border-color:rgba(0,148,137,.25);
}
.inbox-item__subject{font-weight:900;color:var(--c-text)}
.inbox-item__meta{margin-top:4px;font-size:12px;color:var(--c-muted);font-weight:700}
.inbox-item__body{margin-top:6px;color:var(--c-muted);line-height:1.45}

.chat-thread{
  border:1px solid var(--c-border);
  border-radius:8px;
  background:var(--c-surface-2);
  min-height:260px;
  max-height:420px;
  overflow:auto;
  padding:10px;
  display:grid;
  gap:10px;
}
.chat-msg{
  border:1px solid var(--c-border);
  border-radius:8px;
  background:#fff;
  padding:10px;
}
.chat-msg.is-admin{
  background:rgba(204,251,241,.45);
  border-color:rgba(0,148,137,.20);
}
.chat-msg__meta{
  font-size:12px;
  color:var(--c-muted);
  font-weight:800;
}
.chat-msg__body{
  margin-top:6px;
  line-height:1.45;
  white-space:pre-wrap;
}

.stepper{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.stepper__counter{
  font-weight:900;
  color:var(--c-muted);
}
.steps [data-step]{
  display:none;
}
.steps [data-step].is-active{
  display:block;
}

.modal{
  position:fixed;
  inset:0;
  z-index:120;
  display:none;
}
.modal.is-open{display:block}
.modal__overlay{
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.55);
}
.modal__dialog{
  position:relative;
  width:min(560px, calc(100% - 24px));
  margin:72px auto 0;
  background:var(--c-surface);
  border:1px solid var(--c-border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}
.modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.overlay{
  position:fixed;inset:0;z-index:40;
  background:rgba(2,6,23,.45);
  opacity:0;pointer-events:none;
  transition:opacity .18s ease;
  grid-column:1 / -1;
  grid-row:1 / -1;
}
.overlay.is-visible{opacity:1;pointer-events:auto}

@media (min-width: 960px){
  .hero__grid{grid-template-columns:1.2fr .8fr}
  .grid{grid-template-columns:repeat(3,1fr)}
  .app{grid-template-columns:280px 1fr;grid-template-rows:auto 1fr}
  .sidebar{
    position:sticky;
    top:0;
    height:100vh;
    transform:none;
    z-index:5;
    grid-column:1;
    grid-row:1 / span 2;
  }
  .appbar{grid-column:2;grid-row:1}
  .content{grid-column:2;grid-row:2}
  .support-grid{grid-template-columns:1fr 1.2fr}
  .support-admin-grid{grid-template-columns:1fr 1.35fr}
  .overlay{display:none}
  [data-sidebar-open],[data-sidebar-close]{display:none !important}
  .content{padding:22px}
}
