/* ============================================================
   MockPoint — shared/editorial.css  (2026-11)
   The editorial look from the redesigned home + plans pages, as
   reusable pieces for every marketing / account / practice page:
   Instrument Serif headlines (italic <em> accent), DM Sans UI,
   paper & ink colours, flat hairline cards, ink pill buttons,
   accent per exam (orange IELTS / teal Multi Level).

   Load AFTER shared/shared.css. Pair with shared/theme-ink.js for the
   ink-bleed theme switch (it fills #themeToggleBtn with the icon).
   Pre-paint, each page sets data-theme, data-lang and data-exam on
   <html> (exam from localStorage 'mockpoint_exam_type').

   Every component class is prefixed ed- so it never collides with a
   page's older class names. Test-taking pages do NOT use the serif —
   they stay plain and readable.
   ============================================================ */

/* ── Tokens (the :not(#x) bump beats shared.css' theme blocks) ── */
html[data-theme="light"]:not(#x) {
  color-scheme: light;
  --bg: #f5f2ed; --bg-2: #ece8e0; --bg-3: #e4dfd5;
  --ink: #14110f; --on-ink: #f5f2ed;
  --text: #14110f; --muted: #6a655d;
  --line: rgba(20,17,15,0.12); --line-strong: rgba(20,17,15,0.22);
  --card: #f9f7f3; --ok: #1c9a72; --err: #c0392b; --warn: #b7791f;
  --hair-rgb: 20,17,15;
}
html[data-theme="dark"]:not(#x) {
  color-scheme: dark;
  --bg: #0a0a0b; --bg-2: #131315; --bg-3: #1a1a1d;
  --ink: #f4f1ea; --on-ink: #0a0a0b;
  --text: #f4f1ea; --muted: #a19d94;
  --line: rgba(244,241,234,0.10); --line-strong: rgba(244,241,234,0.2);
  --card: #131315; --ok: #2fbf8f; --err: #ef6a5b; --warn: #e0a84a;
  --hair-rgb: 244,241,234;
}
html[data-theme="light"]:not(#x),
html[data-theme="light"][data-exam="ielts"]:not(#x)       { --accent: #d9441c; --accent-rgb: 217,68,28; }
html[data-theme="light"][data-exam="multi_level"]:not(#x) { --accent: #0e8a68; --accent-rgb: 14,138,104; }
html[data-theme="dark"]:not(#x),
html[data-theme="dark"][data-exam="ielts"]:not(#x)        { --accent: #ff6a3d; --accent-rgb: 255,106,61; }
html[data-theme="dark"][data-exam="multi_level"]:not(#x)  { --accent: #34d1a0; --accent-rgb: 52,209,160; }

body.ed {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
body.ed ::selection { background: rgba(var(--accent-rgb), 0.28); }
body.ed > main { flex: 1 0 auto; }
/* body is a flex column (footer at the bottom) — page wrappers with
   margin: 0 auto would otherwise shrink to their content width. */
body.ed > main, body.ed > div { width: 100%; }
body.ed > .ed-nav { height: auto; }

/* ── Nav ── */
.ed-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 48px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.ed-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.2px; color: var(--text); flex-shrink: 0; }
.ed-logo img { width: 26px; height: 26px; object-fit: contain; }
.ed-logo .acc { color: var(--accent); }
.ed-nav-right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.ed-nav-link { font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.ed-nav-link:hover, .ed-nav-link.on { color: var(--text); }
.ed-icon-btn {
  width: 36px; height: 36px; border-radius: 50%; padding: 0; cursor: pointer; flex-shrink: 0;
  background: transparent; border: 1px solid var(--line); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 12px var(--font-ui);
}
.ed-icon-btn:hover { border-color: var(--line-strong); color: var(--accent); }
.ed-icon-btn svg { width: 16px; height: 16px; }

/* ── Page frame & type ── */
.ed-page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 72px 48px 120px; }
.ed-page.narrow { max-width: 760px; }
.ed-eyebrow { display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px; }
.ed-eyebrow::before { content: ''; width: 32px; height: 1px; background: var(--line-strong); }
.ed-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(44px, 6vw, 84px); line-height: 0.98; letter-spacing: -0.025em; margin: 0 0 22px; color: var(--text); }
.ed-title.sm { font-size: clamp(38px, 4.6vw, 60px); line-height: 1.02; }
.ed-title em, .ed-h2 em, .ed-h3 em { font-style: italic; color: var(--accent); }
.ed-sub { font-size: 16px; line-height: 1.65; color: var(--muted); max-width: 600px; margin: 0 0 48px; }
.ed-h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 10px; }
.ed-h3 { font-family: var(--font-serif); font-weight: 400; font-size: 26px; line-height: 1.1; margin: 0 0 6px; }
.ed-muted { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.ed-serif-num { font-family: var(--font-serif); font-variant-numeric: tabular-nums; line-height: 1; }

/* ── Cards ── */
.ed-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
a.ed-card { display: block; color: inherit; text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
a.ed-card:hover { border-color: rgba(var(--accent-rgb), 0.55); transform: translateY(-2px); }
.ed-rule { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.ed-tag {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font: 600 11px var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px;
  border: 1px solid rgba(var(--accent-rgb), 0.4); color: var(--accent);
}
.ed-tag.quiet { border-color: var(--line-strong); color: var(--muted); }

/* ── Buttons ── */
.ed-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 100px; border: 1px solid transparent; cursor: pointer;
  font: 600 14px var(--font-ui); text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--on-ink);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ed-btn:hover { background: var(--accent); color: #fff; }
.ed-btn.block { width: 100%; padding: 15px 0; }
.ed-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ed-btn:disabled:hover { background: var(--ink); color: var(--on-ink); }
.ed-btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.ed-btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.ed-btn.sm { padding: 9px 16px; font-size: 13px; }
.ed-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.ed-link:hover { text-decoration: underline; }

/* ── Inputs ── */
.ed-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 7px; }
.ed-input {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
  font: 500 15px var(--font-ui); transition: border-color 0.15s;
}
.ed-input::placeholder { color: var(--muted); }
.ed-input:focus { outline: none; border-color: var(--accent); }
select.ed-input { cursor: pointer; }

/* ── Segmented toggle (pill group) ── */
.ed-seg { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 100px; padding: 4px; }
.ed-seg button { border: none; background: transparent; cursor: pointer; padding: 9px 18px; border-radius: 100px; font: 600 13.5px var(--font-ui); color: var(--muted); }
.ed-seg button.active { background: var(--ink); color: var(--on-ink); }

/* ── Messages ── */
.ed-msg { font-size: 13.5px; line-height: 1.55; padding: 11px 14px; border-radius: 12px; display: none; }
.ed-msg.error { display: block; background: rgba(192,57,43,0.1); color: var(--err); }
.ed-msg.ok { display: block; background: rgba(28,154,114,0.12); color: var(--ok); }
.ed-msg.info { display: block; background: rgba(var(--hair-rgb),0.05); color: var(--muted); }

/* ── Modal ── */
.ed-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(10,10,11,0.55); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 16px; }
.ed-overlay.open { display: flex; }
.ed-modal { width: 100%; max-width: 420px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,0.25); }
.ed-modal h3 { font-family: var(--font-serif); font-weight: 400; font-size: 32px; line-height: 1.05; margin: 0 0 10px; }
.ed-modal p { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 0 0 22px; }

.ed-spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: ed-spin 0.9s linear infinite; margin: 0 auto 16px; }
@keyframes ed-spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.ed-footer {
  border-top: 1px solid var(--line); padding: 28px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.ed-footer a { color: var(--muted); text-decoration: none; }
.ed-footer a:hover { color: var(--text); }
.ed-footer .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ── Legal pages (offer / refund / contact / privacy / terms) ── */
body.ed .legal-page, body.ed .page-wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 64px 24px 100px; color: var(--text); font-size: 15.5px; line-height: 1.75; }
body.ed .legal-page h1, body.ed .doc-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(40px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 32px; color: var(--text); }
body.ed .legal-page h2, body.ed .page-wrap h2 { font-family: var(--font-serif); font-weight: 400; font-size: 28px; line-height: 1.15; letter-spacing: -0.005em; margin: 44px 0 12px; color: var(--text); }
body.ed .legal-page h3 { font-family: var(--font-ui); font-weight: 600; font-size: 16px; margin: 24px 0 8px; color: var(--text); }
body.ed .legal-page p, body.ed .page-wrap p, body.ed .page-wrap ul li { color: var(--text); }
body.ed .legal-page a, body.ed .page-wrap a { color: var(--accent); }
@media (max-width: 600px) { body.ed .legal-page, body.ed .page-wrap { padding: 40px 16px 72px; } }

body.ed a:focus-visible, body.ed button:focus-visible, body.ed select:focus-visible,
body.ed input:focus-visible, body.ed textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[data-lang="uz"] [data-lang="en"], [data-lang="en"] [data-lang="uz"] { display: none !important; }

@media (max-width: 600px) {
  .ed-nav { padding: 12px 16px; }
  .ed-nav-right { gap: 10px; }
  .ed-nav-link.hide-sm { display: none; }
  .ed-page { padding: 40px 16px 80px; }
  .ed-sub { margin-bottom: 36px; }
  .ed-card { padding: 22px 20px; }
  .ed-footer { padding: 24px 16px; justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .ed-spinner { animation-duration: 3s; } a.ed-card:hover { transform: none; } }
