/* askEllie.app — one stylesheet for the landing pages and the tutor app. */

:root {
  --ink: #1b1a2e;
  --ink-soft: #4b4a63;
  --ink-faint: #6f6e86;
  --bg: #fbfafc;
  --panel: #ffffff;
  --line: #e8e6ef;
  --brand: #4f46e5;
  --brand-dark: #3d35c9;
  --brand-soft: #eef0ff;
  --accent: #f59e0b;
  --accent-soft: #fff4e0;
  --good: #0f9d58;
  --good-soft: #e6f6ec;
  --warn: #b45309;
  --bad: #c0392b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(27, 26, 46, 0.08);
  --shadow-sm: 0 2px 8px rgba(27, 26, 46, 0.06);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 250, 252, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand .spark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 16px; }
.brand em { color: var(--brand); font-style: normal; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--ink-soft); font-weight: 600; font-size: 15px; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 720px) { .site-nav a.optional { display: none; } }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; padding: 12px 22px; transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #fff; text-decoration: none; }
.btn-accent { background: var(--accent); color: #3a2a05; }
.btn-accent:hover { background: #e6900a; text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---- hero ---- */
.hero { padding: 70px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 46px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 34px; } }
.eyebrow { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: 46px; line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 18px; }
.hero h1 em { color: var(--brand); font-style: normal; }
@media (max-width: 720px) { .hero h1 { font-size: 34px; } }
.hero p.lead { font-size: 19px; color: var(--ink-soft); margin: 0 0 26px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: 14px; color: var(--ink-faint); font-size: 14px; }

.phone {
  background: var(--panel); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: var(--shadow); padding: 18px; max-width: 380px; margin-left: auto;
}
.phone .row { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.bubble { border-radius: 14px; padding: 10px 14px; font-size: 15px; max-width: 82%; }
.bubble.ellie { background: var(--brand-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.bubble.learner { background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bubble .fix { display: block; margin-top: 6px; font-size: 13px; color: var(--warn); }
.bubble .tr { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-faint); font-style: italic; }
.phone .mic-line { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; }
.mic-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; }

/* ---- sections ---- */
section.band { padding: 56px 0; }
section.band.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2.section-title { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 8px; }
p.section-sub { color: var(--ink-soft); font-size: 17px; margin: 0 0 32px; max-width: 660px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.card .num { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; margin-bottom: 14px; }

/* ---- levels ---- */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .levels { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .levels { grid-template-columns: 1fr; } }
.level { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.level .code { font-weight: 800; font-size: 22px; color: var(--brand); }
.level .name { font-weight: 700; margin: 2px 0 8px; }
.level .band { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.level p { font-size: 14px; color: var(--ink-soft); margin: 8px 0 0; }

/* ---- app download ---- */
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .download-grid { grid-template-columns: 1fr; } }
.download-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.download-card h3 { margin: 0 0 6px; }
.download-card p { color: var(--ink-soft); font-size: 15px; margin: 0 0 16px; }
ol.steps { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 15px; }
ol.steps li { margin-bottom: 6px; }

/* ---- pricing ---- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.plans.two { grid-template-columns: repeat(2, 1fr); max-width: 720px; margin: 0 auto; }
@media (max-width: 860px) { .plans, .plans.two { grid-template-columns: 1fr; } }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); position: relative; }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow); }
.plan .tag { position: absolute; top: -12px; left: 26px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan h3 { margin: 0 0 4px; font-size: 20px; }
.plan .price { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.plan .price small { font-size: 15px; font-weight: 600; color: var(--ink-faint); }
.plan ul { list-style: none; margin: 18px 0; padding: 0; }
.plan li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-soft); }
.plan li:first-child { border-top: 0; }
.plan .muted { color: var(--ink-faint); font-size: 13px; }

/* ---- forms ---- */
.auth-wrap { max-width: 440px; margin: 48px auto; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.notice.error { background: #fdecea; color: var(--bad); }
.notice.ok { background: var(--good-soft); color: var(--good); }
.notice.info { background: var(--brand-soft); color: var(--brand-dark); }
.tabs { display: flex; gap: 6px; background: var(--brand-soft); padding: 4px; border-radius: 999px; margin-bottom: 22px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 999px; font: inherit; font-weight: 700; color: var(--brand-dark); cursor: pointer; }
.tabs button.active { background: #fff; box-shadow: var(--shadow-sm); }

/* ---- tutor app ---- */
.app-shell { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 64px); }
@media (max-width: 900px) { .app-shell { grid-template-columns: 1fr; } }
.app-side { border-right: 1px solid var(--line); background: #fff; padding: 22px; }
@media (max-width: 900px) { .app-side { border-right: 0; border-bottom: 1px solid var(--line); } }
.app-side h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 0 0 12px; }
.ladder { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.ladder button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 9px 12px; cursor: pointer; font: inherit; display: flex; justify-content: space-between; color: var(--ink); }
.ladder button.active { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.ladder button .band { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.topic-list { display: flex; flex-direction: column; gap: 6px; }
.topic-list button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink-soft); font-size: 14px; }
.topic-list button:hover { background: var(--bg); }
.topic-list button.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.app-main { display: flex; flex-direction: column; min-height: 0; }
.chat { flex: 1; overflow-y: auto; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 720px; width: fit-content; border-radius: 16px; padding: 14px 18px; }
.msg.ellie { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.msg.learner { background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.msg .who { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-bottom: 4px; }
.msg .text { font-size: 16px; white-space: pre-wrap; }
.msg .translation { margin-top: 10px; font-style: italic; color: var(--ink-faint); font-size: 14px; border-top: 1px dashed var(--line); padding-top: 8px; }
.msg.learner .translation { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.3); }
.corrections { margin-top: 12px; background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.corrections h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); }
.corrections .item { font-size: 14px; margin-bottom: 8px; }
.corrections del { color: var(--bad); text-decoration: line-through; }
.corrections ins { color: var(--good); text-decoration: none; font-weight: 700; }
.corrections .why { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.word-chip { background: var(--brand-soft); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--brand-dark); }
.word-chip b { font-weight: 800; }
.tip { margin-top: 8px; font-size: 13px; color: var(--warn); }
.thinking { color: var(--ink-faint); font-size: 14px; font-style: italic; }

.composer { border-top: 1px solid var(--line); background: #fff; padding: 16px 26px 22px; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 52px; max-height: 160px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; font: inherit; }
.composer textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.icon-btn { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 20px; display: grid; place-items: center; }
.icon-btn.mic.recording { background: #fdecea; border-color: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,.4); } 50% { box-shadow: 0 0 0 10px rgba(192,57,43,0); } }
.composer-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; color: var(--ink-faint); gap: 12px; flex-wrap: wrap; }
.speak-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 6px; }
.status-dot.off { background: var(--ink-faint); }

.badge { display: inline-block; background: var(--good-soft); color: var(--good); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge.warn { background: var(--accent-soft); color: var(--warn); }

/* ---- misc ---- */
.site-footer { border-top: 1px solid var(--line); padding: 34px 0; color: var(--ink-faint); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--ink-faint); font-size: 14px; }
.mini-select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; background: #fff; color: var(--ink-soft); max-width: 200px; }
.stack-sm > * + * { margin-top: 10px; }

/* ---- placement test ---- */
.progress { height: 8px; background: var(--brand-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s ease; }
.qmeta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-faint); margin: 10px 0 20px; gap: 12px; }
.question-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.question-card .rung { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 800; }
.question-card .q { font-size: 21px; margin-top: 10px; line-height: 1.45; }
.dots { display: flex; gap: 8px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: block; }
.dots i.on { background: var(--brand); }
.result-level { font-size: 58px; font-weight: 800; letter-spacing: -0.03em; color: var(--brand); line-height: 1; }
.result-name { font-size: 22px; font-weight: 700; margin: 6px 0 10px; }
.evidence { list-style: none; padding: 0; margin: 20px 0; }
.evidence li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.evidence li:first-child { border-top: 0; }
.evidence .lvl { font-weight: 800; min-width: 32px; }
.evidence .pass { color: var(--good); font-weight: 700; }
.evidence .fail { color: var(--bad); font-weight: 700; }
.evidence .note { color: var(--ink-soft); }


/* ---- practice: recurring mistakes and drills ---- */

.summary-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.summary-counts { display: flex; gap: 26px; flex-wrap: wrap; }
.summary-counts > div { display: flex; flex-direction: column; }
.summary-counts b { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--brand); }
.summary-counts span { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.category-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.category-chip b { font-weight: 700; }
.category-chip .chip-count { font-weight: 800; opacity: .75; }

.drill-options { display: grid; gap: 10px; margin-top: 16px; }
.drill-option { text-align: left; font: inherit; font-size: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.drill-option:hover { border-color: var(--brand); background: var(--brand-soft); }
.drill-option.picked { border-color: var(--brand); }
.drill-option.correct { border-color: var(--good); background: var(--good-soft); font-weight: 700; }
.drill-sentence { margin-top: 18px; font-size: 20px; line-height: 1.5; }
.drill-sentence .blank { display: inline-block; min-width: 84px; border-bottom: 2px dashed var(--brand); }
.drill-sentence .wrong-line { color: var(--bad); }
.drill-input-row { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.drill-input-row input { flex: 1; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; font: inherit; font-size: 16px; }
.drill-input-row input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.drill-seen { margin: 16px 0 0; font-size: 13px; color: var(--ink-faint); }

.drill-feedback { border-radius: 12px; padding: 14px 16px; margin: 18px 0; font-size: 15px; }
.drill-feedback.right { background: var(--good-soft); }
.drill-feedback.wrong { background: var(--accent-soft); }
.drill-feedback b { display: block; font-size: 16px; }
.drill-feedback .fb-note { color: var(--warn); font-size: 13px; }
.drill-feedback .fb-answer { margin-top: 8px; }
.drill-feedback .fb-answer ins { color: var(--good); font-weight: 700; text-decoration: none; }
.drill-feedback .fb-why { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; }
.drill-feedback .fb-plan { margin: 8px 0 0; font-size: 13px; color: var(--ink-faint); }

.notes-section { margin-top: 34px; }
.mistake-list { display: grid; gap: 12px; }
.mistake { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.mistake.due { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.mistake-head { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; }
.mistake-shape { font-size: 15px; }
.mistake-shape del { color: var(--bad); text-decoration: line-through; }
.mistake-shape ins { color: var(--good); text-decoration: none; font-weight: 700; }
.mistake-shape .arrow { color: var(--ink-faint); margin: 0 6px; }
.mistake .occurrences { font-size: 12px; font-weight: 800; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.mistake-why { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); }
.mistake-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; font-size: 12px; color: var(--ink-faint); }
.pill { border-radius: 999px; padding: 3px 10px; background: var(--bg); border: 1px solid var(--line); }
.pill.cat-tense, .pill.cat-agreement { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }
.pill.cat-articles, .pill.cat-prepositions { background: var(--accent-soft); border-color: transparent; color: var(--warn); }
.pill.cat-spelling { background: #fdecea; border-color: transparent; color: var(--bad); }
.pill.warn { background: #fdecea; border-color: transparent; color: var(--bad); font-weight: 700; }
.pill.quiet { opacity: .8; }
.mistake-actions { margin-top: 10px; }
.resolved-row { opacity: .75; }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--brand); cursor: pointer; }
.linklike:hover { text-decoration: underline; }
