/* app.css - eLexa Scroll. Paleta monocromă eLexa (alb/negru, accent teracotă; canonul DESIGN-monocrom, ca în Codul viu),
   Poppins 400-700, mod întunecat automat. Numele vechi de variabile rămân ca alias-uri peste tokenii monocromi. Mobil întâi. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --ink: #141413; --muted: #6b6a66; --line: #e5e3dd; --warm: #f7f6f2; --warm2: #fbf3ee;
  --accent: #d97757; --accent2: #c2410c; --sheet: #ffffff; --bg: #f7f6f2; --err: #b42318; --ok: #2f6b3a;
  --umbra: 0 1px 2px rgba(20,20,19,.04), 0 4px 16px rgba(20,20,19,.05);
  --voal: rgba(20,20,19,.45);
  --hdr: 60px; --tab: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #f2f0ea; --muted: #a3a19b; --line: #34332f; --warm: #1f1f1d; --warm2: #2a211d;
  --accent: #e08a6c; --accent2: #f0a07f; --sheet: #1a1a18; --bg: #121211; --err: #f0918a; --ok: #8fcf9a;
  --umbra: none; --voal: rgba(0,0,0,.6); color-scheme: dark; } }
:root[data-theme="dark"] {
  --ink: #f2f0ea; --muted: #a3a19b; --line: #34332f; --warm: #1f1f1d; --warm2: #2a211d;
  --accent: #e08a6c; --accent2: #f0a07f; --sheet: #1a1a18; --bg: #121211; --err: #f0918a; --ok: #8fcf9a;
  --umbra: none; --voal: rgba(0,0,0,.6); color-scheme: dark; }
:root {
  /* alias-uri pentru numele folosite în componente */
  --dark: var(--ink); --text: var(--ink); --mid: var(--accent2); --light: var(--warm); --border: var(--line);
  --white: var(--sheet); --page: var(--bg); --gold: var(--warm2); --gold2: var(--accent); --gold-ink: var(--accent2);
  --grila: var(--accent2); --grila-soft: var(--warm2); --flash: var(--ink);
  --ok-bg: color-mix(in srgb, var(--ok) 10%, var(--sheet)); --ok-ink: var(--ok);
  --err-bg: color-mix(in srgb, var(--err) 9%, var(--sheet)); --err-ink: var(--err);
  --shadow: var(--umbra);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); font-family: 'Poppins', sans-serif; color: var(--text); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
a { color: var(--accent2); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

/* ---------- bara de sus ---------- */
.hdr { position: fixed; top: 0; left: 0; right: 0; height: calc(var(--hdr) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0; background: color-mix(in srgb, var(--sheet) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); color: var(--ink); display: flex; align-items: center; gap: 10px; z-index: 20; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo .semn { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--sheet); display: grid; place-items: center; font-weight: 700; font-size: 15px; position: relative; }
.logo .semn::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.logo b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.logo span:not(.semn) { font-size: 13px; color: var(--muted); font-weight: 500; }
.hdr-sp { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--warm); color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.pill.gold { background: var(--warm2); color: var(--accent2); }

/* ---------- conținut și bara de jos ---------- */
.main { padding: calc(var(--hdr) + 14px) 16px calc(var(--tab) + var(--safe-b) + 20px); max-width: 620px; margin: 0 auto; }
.main.feed-mode { padding: var(--hdr) 0 0; max-width: none; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--tab) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--sheet) 95%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--border); display: flex; z-index: 20; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; position: relative; }
.tabs button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tabs button.on { color: var(--ink); font-weight: 600; }
.tabs button.on svg { color: var(--accent2); }
.tabs .dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--err); color: var(--sheet); font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

/* ---------- elemente comune ---------- */
.sec-label { color: var(--mid); font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; }
.h1 { font-size: 22px; font-weight: 700; color: var(--dark); margin: 4px 0 6px; line-height: 1.25; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.card { background: var(--sheet); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--ink); background: var(--ink); color: var(--sheet); border-radius: 999px; padding: 12px 16px; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; }
.btn.sec { background: var(--sheet); color: var(--dark); border-color: var(--border); }
.btn.mid { background: var(--accent2); border-color: var(--accent2); color: var(--sheet); }
.btn.sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.link { background: none; border: 0; color: var(--mid); font-weight: 600; cursor: pointer; padding: 0; font-size: 13px; }
.msg { font-size: 13px; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.msg.err { background: var(--err-bg); color: var(--err-ink); border-left: 3px solid var(--err); }
.msg.ok { background: var(--ok-bg); color: var(--ok-ink); border-left: 3px solid var(--ok); }
.msg.info { background: var(--gold); color: var(--gold-ink); border-left: 3px solid var(--gold2); }
.bar { height: 6px; background: var(--light); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--light); border-top-color: var(--mid); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea { width: 100%; font: 15px 'Poppins', sans-serif; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--sheet); color: var(--text); }
textarea { min-height: 90px; resize: vertical; }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--dark); margin: 12px 0 5px; }

/* ---------- alegeri (onboarding, profil) ---------- */
.opt { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--sheet); margin-bottom: 8px; cursor: pointer; }
.opt.on { border-color: var(--ink); background: var(--warm); }
.opt .t { font-weight: 600; color: var(--dark); font-size: 14px; }
.opt .d { color: var(--muted); font-size: 12px; }
.opt .chk { margin-left: auto; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center; flex: none; color: transparent; font-size: 13px; }
.opt.on .chk { background: var(--dark); border-color: var(--dark); color: var(--sheet); }
.seg { display: flex; background: var(--light); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--sheet); color: var(--dark); box-shadow: var(--shadow); }
.steps { color: var(--muted); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }

/* ---------- feed pe ecran întreg ---------- */
.feed { height: calc(100dvh - var(--hdr) - var(--tab) - var(--safe-b)); overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; }
.slide { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; padding: 14px 16px; }
.slide > .sheet { margin: auto; width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; background: var(--sheet); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 20px 18px; display: flex; flex-direction: column; }
.eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: var(--warm); color: var(--muted); }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag.gold { background: var(--gold); color: var(--gold-ink); }
.tag.teal { background: var(--grila-soft); color: var(--grila); }
.sheet .titlu { font-size: 21px; line-height: 1.3; font-weight: 700; color: var(--dark); margin: 12px 0 2px; }
.sheet .subtitlu { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.sheet .corp { font-size: 16.5px; line-height: 1.65; color: var(--text); margin: 6px 0 16px; }
.sheet .src { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.sheet .src b { color: var(--dark); font-weight: 600; }
.sheet .acts { display: flex; gap: 8px; margin-top: 12px; }
.sheet .acts .btn { flex: 1; }
.hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
.intro .lista { margin: 10px 0 0; padding: 0; list-style: none; }
.intro .lista li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; display: flex; gap: 10px; }
.intro .lista li span { color: var(--mid); font-weight: 700; min-width: 22px; }
.intro .lista .lt { font-weight: 600; }
.intro .lista .lc { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }

/* ---------- exerciții ---------- */
.ex .ctx { background: var(--grila-soft); border-left: 3px solid var(--grila); border-radius: 8px; padding: 10px 12px; font-size: 14px; color: var(--text); margin: 10px 0; max-height: 34vh; overflow-y: auto; }
.ex .enunt { font-size: 16px; font-weight: 600; color: var(--dark); margin: 8px 0 14px; line-height: 1.5; }
.ex .var { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--sheet); border-radius: 12px; padding: 12px; margin-bottom: 8px; font-size: 14.5px; cursor: pointer; color: var(--text); }
.ex .var .l { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--grila-soft); color: var(--grila); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.ex .var.ok { border-color: var(--ok); background: var(--ok-bg); }
.ex .var.ok .l { background: var(--ok); color: var(--sheet); }
.ex .var.no { border-color: var(--err); background: var(--err-bg); }
.ex .var.no .l { background: var(--err); color: var(--sheet); }
.ex .var:disabled { cursor: default; }
.ex .tf { display: flex; gap: 10px; }
.ex .tf .var { justify-content: center; font-weight: 700; }
.ex .expl { border-radius: 10px; padding: 12px; font-size: 14px; margin-top: 6px; }
.ex .expl.ok { background: var(--ok-bg); color: var(--ok-ink); border-left: 3px solid var(--ok); }
.ex .expl.no { background: var(--err-bg); color: var(--err-ink); border-left: 3px solid var(--err); }
.ex .expl b { display: block; margin-bottom: 4px; }

/* ---------- explorare ---------- */
.mat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px 10px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.mat-tabs button { flex: none; border: 1px solid var(--border); background: var(--sheet); color: var(--muted); padding: 7px 12px; border-radius: 20px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.mat-tabs button.on { background: var(--dark); border-color: var(--dark); color: var(--sheet); }
.secg { margin: 18px 0 6px; }
.cap { display: block; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--sheet); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-family: inherit; }
.cap .n { font-weight: 600; color: var(--dark); font-size: 14px; }
.cap .m { color: var(--muted); font-size: 12px; margin: 2px 0 8px; display: flex; justify-content: space-between; }
.cap.gata .n::after { content: " ✓"; color: var(--ok); }
.res { border: 1px solid var(--border); border-radius: 12px; background: var(--sheet); padding: 12px; margin-bottom: 8px; cursor: pointer; }
.res .t { font-weight: 600; color: var(--dark); font-size: 14px; }
.res .c { font-size: 13px; color: var(--text); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.res .s { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ---------- profil ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--sheet); border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat .v { font-size: 20px; font-weight: 700; color: var(--dark); }
.stat .k { font-size: 11px; color: var(--muted); }
.ins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ins div { border: 1px dashed var(--border); border-radius: 12px; padding: 10px 6px; text-align: center; font-size: 11.5px; color: var(--muted); }
.ins div.on { border-style: solid; border-color: var(--gold2); background: var(--gold); color: var(--gold-ink); font-weight: 600; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.row:last-child { border-bottom: 0; }

/* ---------- foaia de detaliu (card) ---------- */
.overlay { position: fixed; inset: 0; background: var(--voal); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.panel { background: var(--bg); width: 100%; max-width: 620px; max-height: 92dvh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(24px + var(--safe-b)); }
.panel .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 12px; }
.panel .close { float: right; }
.art { background: var(--sheet); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; font-size: 14px; white-space: pre-line; }
.art .h { font-weight: 700; color: var(--dark); margin-bottom: 6px; white-space: normal; }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab) + var(--safe-b) + 14px); transform: translateX(-50%); background: var(--dark); color: var(--sheet); padding: 9px 14px; border-radius: 20px; font-size: 13px; z-index: 60; box-shadow: var(--shadow); }

@media (min-width: 900px) {
  .slide > .sheet { padding: 28px 30px; }
  .sheet .corp { font-size: 17.5px; }
}

/* ---------- pagini fără bara aplicației (login, documente) ---------- */
.antet { max-width: 420px; margin: 0 auto; padding: 36px 16px 18px; }
.antet .eb { color: var(--accent2); letter-spacing: .08em; text-transform: uppercase; font-size: 11.5px; font-weight: 600; margin: 22px 0 4px; }
.antet h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.antet p { color: var(--muted); margin: 0; font-size: 14px; }
mark { background: var(--warm2); color: var(--accent2); padding: 0 3px; border-radius: 3px; }

/* ---------- evaluarea utilizatorului ---------- */
.evaluare { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; font-size: 13px; color: var(--muted); }
.evaluare .note3 { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.evaluare .nota { font: inherit; font-size: 13px; background: transparent; color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.evaluare .nota[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 600; }
.evaluare .motive { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.evaluare .motive label { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 13px; }
.evaluare textarea { min-height: 56px; margin-top: 8px; font-size: 14px; }

/* ---------- adevărat/fals cu glisare ---------- */
.ex.af { touch-action: pan-y; transition: transform .18s ease; user-select: none; -webkit-user-select: none; }
.ex.af.spre-a { box-shadow: inset 4px 0 0 var(--ok); }
.ex.af.spre-f { box-shadow: inset -4px 0 0 var(--err); }
.ex .note.cap { color: var(--accent2); font-weight: 600; }
.hint.gl { margin-top: 10px; }

/* ---------- capcana din feed ---------- */
.sheet.capcana .fam { text-transform: none; letter-spacing: 0; font-weight: 500; }
.sheet.capcana .fals { margin-top: 6px; font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--warm2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; }
.sheet.capcana .de { margin-top: 6px; }

/* ---------- imagini ---------- */
.fig { margin: 8px 0 0; cursor: zoom-in; }
.fig img { display: block; width: 100%; max-height: 60dvh; object-fit: contain; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; }
.fig figcaption { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.overlay.viz { flex-direction: column; align-items: stretch; justify-content: flex-start; background: var(--bg); z-index: 70; }
.viz-bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--sheet); }
.viz-bar .t { flex: 1; font-size: 13.5px; font-weight: 600; }
.viz-in { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 12px; }
.viz-in img { max-width: 100%; height: auto; cursor: zoom-in; background: var(--sheet); border-radius: 8px; }
.viz-in img.mare { max-width: none; width: 220%; cursor: zoom-out; }
.viz-n { text-align: center; padding-bottom: calc(10px + var(--safe-b)); }

/* ---------- jurisprudența pe card ---------- */
.dec { border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); margin-bottom: 6px; }
.dec-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.dec-h b { font-size: 13.5px; }
.dec-s { font-size: 12.5px; color: var(--muted); }
.dec-t { padding: 0 12px 12px; font-size: 13.5px; line-height: 1.6; white-space: pre-line; }

/* ---------- exersează și liste ---------- */
.card.slab b { font-size: 14px; }
.card.slab .pc { font-size: 13px; color: var(--accent2); font-weight: 600; }
.res .nt { margin-top: 6px; font-size: 12.5px; color: var(--ink); background: var(--warm2); border-radius: 8px; padding: 6px 8px; }
.row .fv { white-space: nowrap; }
.tabs button { font-size: 10.5px; }
