/* ==========================================================================
   Elite Language Pro — Learning Studio (Phase 1)
   styles.css — one stylesheet, no external fonts or images.
   Palette: pale blue-grey background, white cards, near-black navy text,
   medium blue links/buttons, light blue pills, ELP orange #F5820B accent.
   ========================================================================== */

:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --navy: #131c33;
  --navy-deep: #16254a;
  --blue: #2450a4;
  --blue-dark: #1b3d82;
  --pill: #e8effc;
  --pill-strong: #d7e3f9;
  --border: #dde4f0;
  --muted: #56617a;
  --orange: #f5820b;
  --orange-dark: #dd7205;
  --green: #17734a;
  --green-bg: #e6f5ee;
  --red: #b3261e;
  --red-bg: #fdecea;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(19, 28, 51, .04), 0 8px 24px rgba(19, 28, 51, .05);
  --sidebar: 300px;
  --font: "Inter", "Avenir Next", "Avenir", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--navy);
  background: var(--bg);
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
button { font: inherit; color: inherit; }
.icon { flex: none; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
h1:focus, .score:focus, main:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- sidebar ------------------------------------------------------ */

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 28px 22px 24px; z-index: 10;
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--navy); margin-bottom: 30px; }
.brand-mark { flex: none; width: 52px; height: 46px; display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 14px; text-decoration: none; color: var(--navy);
  font-weight: 700; font-size: 16px; line-height: 1.25;
}
.nav-item .icon { color: var(--blue-dark); }
.nav-item:hover { background: #f1f5fd; color: var(--navy); }
.nav-item.is-active { background: var(--pill); }

.sidebar-foot { margin-top: auto; font-size: 15px; font-weight: 600; text-decoration: none; padding: 8px 16px; }
.sidebar-foot:hover { text-decoration: underline; }

/* ---------- main --------------------------------------------------------- */

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 22px 40px 0; max-width: 1180px; width: 100%;
}
.topbar-title { font-weight: 700; color: var(--muted); font-size: 16px; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--pill); color: var(--blue-dark);
  font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }

#view { padding: 22px 40px 40px; max-width: 1180px; width: 100%; flex: 1; }
.page > * + * { margin-top: 18px; }

.page-foot { padding: 28px 40px 36px; max-width: 1180px; width: 100%; border-top: 1px solid var(--border); }
.foot-brand { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--blue-dark); }
.foot-line { color: var(--muted); margin-top: 4px; }
.foot-link { display: none; margin-top: 10px; font-weight: 600; }

/* ---------- type --------------------------------------------------------- */

.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); }
.eyebrow.on-navy { color: #b9cdf6; }

.page-title { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin-top: 8px !important; }
.page-sub { font-size: 18px; color: var(--muted); max-width: 62ch; margin-top: 12px !important; }
.section { margin-top: 40px !important; }
.section-title { font-size: clamp(24px, 3vw, 30px); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; margin-top: 6px; }
.section-title.small { font-size: 20px; letter-spacing: -.01em; margin-top: 4px; }
.section-sub { color: var(--muted); margin-top: 8px; }
.section .grid, .section .activity-list { margin-top: 18px; }
.lead { font-size: 18px; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); }
.crumb { font-size: 15px; font-weight: 600; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.level-word { color: var(--blue); }

/* ---------- cards -------------------------------------------------------- */

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px;
}
.card > * + * { margin-top: 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.placard { position: relative; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s, transform .15s; }
.placard > * + * { margin-top: 0; }
.placard:hover { border-color: #b9c9e8; box-shadow: 0 2px 4px rgba(19, 28, 51, .05), 0 12px 28px rgba(19, 28, 51, .09); transform: translateY(-1px); }
.placard.is-mine { border-color: var(--orange); }
.placard-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--pill); color: var(--blue-dark);
  display: grid; place-items: center; margin-bottom: 14px; flex: none;
}
.placard-icon.big { width: 56px; height: 56px; border-radius: 15px; margin-bottom: 0; }
.placard-title { font-size: 21px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.placard-sub { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.placard-desc { color: var(--muted); margin-top: 8px; font-size: 16px; }
.placard-meta { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.placard-meta.has-score { color: var(--green); }
.placard-link { margin-top: auto; padding-top: 16px; font-weight: 800; text-decoration: none; align-self: flex-start; }
.placard-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.placard-link:focus-visible { outline: none; }
.placard-link:focus-visible::after { outline: 3px solid var(--blue); outline-offset: 3px; }

.soon-card { background: #f9fbff; border-style: dashed; box-shadow: none; }
.notice { background: var(--pill); border-radius: 14px; padding: 14px 18px; }

.tag {
  display: inline-block; vertical-align: middle; padding: 3px 10px; border-radius: 999px;
  background: var(--pill); color: var(--blue-dark);
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; line-height: 1.5;
}
.tag-sample { background: #fff1df; color: #8a4a00; }
.tag-accent { background: var(--orange); color: var(--navy); }

/* ---------- buttons ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 800; font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--blue-dark); color: #fff; }
.btn-accent { background: var(--orange); color: var(--navy); }
.btn-accent:hover:not([disabled]) { background: var(--orange-dark); color: var(--navy); }
.btn-ghost { background: #fff; color: var(--blue-dark); border-color: var(--border); }
.btn-ghost:hover:not([disabled]) { border-color: var(--blue); color: var(--blue-dark); }
.btn-onnavy { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-onnavy:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.next-steps { margin-top: 24px !important; }

.link-btn { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font-size: 14px; }
.clear-line { text-align: right; }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.cta-note { color: var(--muted); font-size: 15px; }

/* ---------- hero (Overview) ---------------------------------------------- */

.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 44px 44px 40px; color: #fff;
  background: linear-gradient(120deg, #16254a 0%, #1f3f8a 62%, #2c59ad 100%);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -30px; width: 380px; height: 380px; opacity: .13; pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19L19 5M8 5h11v11'/%3E%3C/svg%3E");
}
.hero > * { position: relative; z-index: 1; }
.hero-title { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; margin-top: 12px; max-width: 16ch; }
.hero-title:focus { outline: none; }
.hero-text { font-size: 19px; color: #dbe6fb; max-width: 54ch; margin-top: 16px; }
.hero-entry {
  margin-top: 28px; padding: 22px 24px; border-radius: 18px; max-width: 640px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
}
.hero-entry-label { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #ffc98a; }
.hero-entry-text { font-size: 17px; margin-top: 6px; color: #fff; }
.hero-level { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; }
.hero :focus-visible { outline-color: #fff; }

/* ---------- area page + tabs --------------------------------------------- */

.area-head { display: flex; align-items: center; gap: 16px; }
.area-head .page-title { margin-top: 4px !important; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px !important; }
.tab {
  padding: 10px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--border);
  font-weight: 700; font-size: 15px; text-decoration: none; color: var(--navy);
}
.tab:hover { border-color: var(--blue); color: var(--navy); }
.tab.is-active { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; }

.activity-list { display: grid; gap: 14px; }
.activity-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.activity-row > * + * { margin-top: 0; }
.activity-name { font-size: 19px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }

/* ---------- activity + quiz ---------------------------------------------- */

.activity-card { max-width: 760px; padding: 30px; }
.progress-line { display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--pill); overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.task { font-size: 16px; font-weight: 700; color: var(--muted); margin-top: 22px !important; }
.stimulus { font-size: clamp(24px, 3.6vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-top: 8px !important; overflow-wrap: anywhere; }

.stimulus.quiz-stimulus { font-size: clamp(20px, 2.6vw, 25px); line-height: 1.3; }
.options { display: grid; gap: 10px; margin-top: 22px !important; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 18px; background: #fff; border: 1.5px solid var(--border); border-radius: 14px;
  font-size: 18px; font-weight: 600; cursor: pointer; transition: border-color .12s, background .12s;
}
.option:hover:not([disabled]) { border-color: var(--blue); background: #f7faff; }
.option[disabled] { cursor: default; color: var(--navy); }
.option-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b6c2d9; background: #fff; }
.option.is-selected { border-color: var(--blue); background: var(--pill); }
.option.is-selected .option-mark { border-color: var(--blue); background: radial-gradient(circle, var(--blue) 0 45%, #fff 50%); }
.option.is-correct { border-color: var(--green); background: var(--green-bg); }
.option.is-correct .option-mark { border-color: var(--green); background: var(--green); }
.option.is-wrong { border-color: var(--red); background: var(--red-bg); }
.option.is-wrong .option-mark { border-color: var(--red); background: var(--red); }

.feedback { min-height: 0; margin-top: 16px !important; }
.feedback:empty { display: none; }
.feedback.is-correct, .feedback.is-wrong { padding: 14px 18px; border-radius: 14px; }
.feedback.is-correct { background: var(--green-bg); color: #0f5234; }
.feedback.is-wrong { background: var(--red-bg); color: #8a1c16; }
.feedback strong { display: inline-flex; align-items: center; gap: 6px; vertical-align: bottom; }

.check-list { display: grid; gap: 10px; }
.check-list li { display: flex; align-items: center; gap: 10px; }
.check-list .icon { color: var(--green); }

.score { font-size: 22px; font-weight: 700; margin-top: 4px !important; }
.score-num { font-size: 52px; font-weight: 800; letter-spacing: -.03em; color: var(--blue); line-height: 1; margin-right: 6px; }
.result-card .section-title { margin-top: 26px !important; }
.saved-note { font-size: 14px; margin-top: 18px !important; }

.loop { display: grid; gap: 10px; margin-top: 14px !important; }
.loop-slot {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: #fff;
  text-decoration: none; color: var(--navy); cursor: pointer;
}
a.loop-slot:hover, button.loop-slot:hover { border-color: var(--blue); background: #f7faff; color: var(--navy); }
.loop-slot > span:nth-child(2) { flex: 1; min-width: 0; }
.loop-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--pill); color: var(--blue-dark); display: grid; place-items: center; flex: none; }
.loop-title { display: block; font-weight: 800; }
.loop-note { display: block; font-size: 14px; color: var(--muted); }
.loop-arrow { font-weight: 800; color: var(--blue); }
.loop-slot.is-soon { border-style: dashed; background: #f9fbff; cursor: default; }
.loop-slot.is-soon .loop-icon { background: #eef1f6; color: #7c879d; }
.loop-slot.is-soon .loop-title { color: var(--muted); }

/* ---------- placement result --------------------------------------------- */

.result-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; margin-top: 24px !important; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; background: #fff1df; color: #7a4100; font-weight: 700; font-size: 15px; }
.result-grid .section-title { margin-top: 22px !important; }
.topic-list { border-top: 1px solid var(--border); }
.topic-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.topic-score { font-weight: 800; white-space: nowrap; }
.topic-score.is-weak { color: #a85a00; }

.lead-form { display: grid; gap: 8px; margin-top: 14px !important; }
.lead-form label { font-weight: 700; font-size: 15px; margin-top: 6px; }
.optional { font-weight: 500; color: var(--muted); }
.lead-form input, textarea {
  width: 100%; font: inherit; color: var(--navy); background: #fff;
  border: 1.5px solid #c5cfe2; border-radius: 12px; padding: 12px 14px;
}
.lead-form input:focus, textarea:focus { outline: 3px solid rgba(36, 80, 164, .3); border-color: var(--blue); }
.lead-form .btn { margin-top: 10px; justify-self: start; }
.form-status { font-size: 14px; color: var(--muted); }
.form-status:empty { display: none; }
.form-status.is-ok { color: var(--green); font-weight: 700; }
.form-status.is-error { color: var(--red); font-weight: 600; }

/* ---------- progress ----------------------------------------------------- */

.progress-level { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 24px !important; }
.progress-level > * + * { margin-top: 0; }
.progress-done { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.progress-level-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.score-table { width: 100%; border-collapse: collapse; margin-top: 14px !important; font-size: 16px; }
.score-table th, .score-table td { text-align: left; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.score-table thead th { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.score-table tbody th { font-weight: 700; }
.score-table tbody tr:last-child th, .score-table tbody tr:last-child td { border-bottom: 0; }
.row-area { display: block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.score-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--green-bg); color: var(--green); white-space: nowrap; }

/* ---------- The Breakdown ------------------------------------------------ */

.article-body { max-width: 760px; padding: 34px; }
.article-body > * + * { margin-top: 14px; }
.article-body h2 { font-size: 22px; letter-spacing: -.01em; margin-top: 28px; }
.article-body ul { list-style: disc; padding-left: 22px; display: grid; gap: 6px; }
.examples { display: grid; gap: 8px; }
.example { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--bg); }
.example strong { letter-spacing: .02em; }
.practice-link { max-width: 760px; border-color: var(--orange); }
.practice-link .btn { margin-top: 14px; }

/* ---------- With Elite Language Pro -------------------------------------- */

.book-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 24px !important; }
.book-card > * + * { margin-top: 0; }
.book-card > div > * + * { margin-top: 6px; }
textarea { resize: vertical; min-height: 180px; line-height: 1.5; }
.notes-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- responsive --------------------------------------------------- */

@media (max-width: 960px) {
  .sidebar { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 16px 16px 12px; }
  .brand { margin-bottom: 12px; }
  .brand-mark, .brand-mark svg { width: 46px; height: 40px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: none; padding: 10px 14px; font-size: 15px; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .foot-link { display: inline-block; }
  .main { margin-left: 0; min-height: 0; }
  .topbar { padding: 16px 20px 0; }
  #view { padding: 16px 20px 32px; }
  .page-foot { padding: 24px 20px 32px; }
  .hero { padding: 32px 26px 28px; border-radius: 22px; }
  .hero::after { width: 260px; height: 260px; right: -50px; }
  .result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .card { padding: 20px; }
  .activity-card, .article-body { padding: 22px 18px; }
  .hero { padding: 26px 20px 22px; }
  .hero-entry { padding: 18px; }
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .btn-row .btn, .book-card .btn, .activity-row .btn { width: 100%; }
  .option { font-size: 17px; padding: 13px 14px; }
  .score-num { font-size: 44px; }
  .progress-line { flex-wrap: wrap; white-space: normal; }
  .progress-track { flex-basis: 100%; }

  /* Score table becomes stacked cards on phones. */
  .score-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .score-table, .score-table tbody, .score-table tr, .score-table th, .score-table td { display: block; width: 100%; }
  .score-table tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .score-table tbody tr:last-child { border-bottom: 0; }
  .score-table th, .score-table td { border: 0; padding: 4px 0; }
  .score-table td { display: flex; justify-content: space-between; gap: 12px; }
  .score-table td::before { content: attr(data-label); color: var(--muted); font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .sidebar, .topbar, .page-foot { display: none; }
  .main { margin: 0; }
}
