/* Claude Study: "Fișe" (index cards). Day palette on :root, night palette mirrors the design's derived night artboards. */
:root {
  --bg: #EEF1F6; --surface: #FFFFFF; --ink: #18213A; --muted: #5A6478; --line: #D3D9E5; --rule: #E6EBF4;
  --acc: #2B4FD8; --acc-h: #1E3AA8; --on-acc: #FFFFFF; --sel: #E8EDFF; --hero-sub: #DCE3FF;
  --red: #C43D32; --ok: #1D7A45; --ok-bg: #E3F4EA; --bad-bg: #FBE9E7; --warn: #9A5B00; --warn-bg: #FFF1DA;
  --teal: #0B6B5E; --teal-bg: #DFF2EE; --ctl: #A3336A;
  --shadow: 0 1px 2px rgba(24,33,58,0.08);
  --display: 'Instrument Sans', Arial, sans-serif;
  --body: 'Atkinson Hyperlegible', Verdana, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #10141D; --surface: #1A2030; --ink: #E6EAF3; --muted: #98A2B8; --line: #2C3448; --rule: #232A3C;
  --acc: #7C97FF; --acc-h: #A9BBFF; --on-acc: #1A2030; --sel: #232C4D; --hero-sub: #1E2A55;
  --red: #E0645A; --ok: #5CCB86; --ok-bg: #13301F; --bad-bg: #3A1A18; --warn: #F0B45A; --warn-bg: #36290F;
  --teal: #5FD3C0; --teal-bg: #12342F; --ctl: #EC84B5; --shadow: 0 1px 2px rgba(0,0,0,0.35); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #10141D; --surface: #1A2030; --ink: #E6EAF3; --muted: #98A2B8; --line: #2C3448; --rule: #232A3C;
  --acc: #7C97FF; --acc-h: #A9BBFF; --on-acc: #1A2030; --sel: #232C4D; --hero-sub: #1E2A55;
  --red: #E0645A; --ok: #5CCB86; --ok-bg: #13301F; --bad-bg: #3A1A18; --warn: #F0B45A; --warn-bg: #36290F;
  --teal: #5FD3C0; --teal-bg: #12342F; --ctl: #EC84B5; --shadow: 0 1px 2px rgba(0,0,0,0.35); color-scheme: dark }

* { box-sizing: border-box }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--body); -webkit-font-smoothing: antialiased }
button, input, textarea, select { font: inherit; color: inherit }
button { cursor: pointer }
a { color: var(--acc) } a:hover { color: var(--acc-h) }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; border-radius: 6px }
h1, h2, h3 { margin: 0; font-family: var(--display); text-wrap: balance }
p { margin: 0 }
[hidden] { display: none !important }

.app { max-width: 640px; margin: 0 auto; min-height: 100dvh; padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(98px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 18px }
.app.notabs { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) }
.app.center { justify-content: center }

/* type */
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.h1 { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.1; letter-spacing: -.02em }
.h2 { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.15 }
.qh { font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.35 }
.muted { color: var(--muted) } .small { font-size: 14px } .tiny { font-size: 12px }
.en { font-weight: 500; color: var(--muted) }
b.t { color: var(--acc); font-weight: 700 }
.stack { display: flex; flex-direction: column; gap: 4px } .gap8 { gap: 8px } .gap12 { gap: 12px } .gap16 { gap: 16px }
.row { display: flex; align-items: center; gap: 10px } .between { justify-content: space-between } .wrap { flex-wrap: wrap }
.grow { flex-grow: 1; min-width: 0 }

/* surfaces */
.card { background: var(--surface); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow) }
.fisa { background-color: var(--surface); background-image: repeating-linear-gradient(180deg, transparent 0, transparent 27px, var(--rule) 27px, var(--rule) 28px); border-radius: 14px; border-top: 4px solid var(--red); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px }
.panel { background: var(--bg); border-radius: 10px; padding: 10px 12px }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700 }
.pill.teal { background: var(--teal-bg); color: var(--teal) }
.pill.warn { background: var(--warn-bg); color: var(--warn) }
.pill.line { background: var(--surface); border: 1px solid var(--line) }
.box-ok { background: var(--ok-bg); border: 1.5px solid var(--ok); border-radius: 12px; padding: 12px 14px }
.box-bad { background: var(--bad-bg); border: 1.5px solid var(--red); border-radius: 12px; padding: 12px 14px }
.box-warn { background: var(--warn-bg); border: 1.5px solid var(--warn); border-radius: 12px; padding: 12px 14px }
.lab-ok { color: var(--ok); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase }
.lab-bad { color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase }
.lab-warn { color: var(--warn); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase }

/* controls */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 14px; border: 0; background: var(--acc); color: var(--on-acc); font-family: var(--display); font-weight: 700; font-size: 17px; text-decoration: none; padding: 0 18px }
.btn:hover { background: var(--acc-h); color: var(--on-acc) }
.btn.sec { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line) }
.btn.sec:hover { border-color: var(--ink) }
.btn:disabled { opacity: .45; cursor: not-allowed }
.btn.sm { height: 44px; font-size: 15px; border-radius: 12px }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700 }
.chipbtn[aria-pressed="true"] { border-color: var(--acc); color: var(--acc) }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0 }
.back { display: flex; align-items: center; gap: 6px; height: 44px; font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink); background: none; border: 0; padding: 0 }
.input { height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 14px; font-size: 16px; width: 100% }
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.5; resize: vertical }
.bar { height: 6px; border-radius: 9px; background: var(--rule); overflow: hidden } .bar > i { display: block; height: 100%; background: var(--acc) }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 44px }

/* options */
.opts { display: flex; flex-direction: column; gap: 10px }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; line-height: 1.4; width: 100% }
.opt .k { font-weight: 700; color: var(--muted) }
.opt.sel { border: 2px solid var(--acc); background: var(--sel) } .opt.sel .k { color: var(--acc) }
.opt.right { border: 2px solid var(--ok); background: var(--ok-bg) } .opt.right .k { color: var(--ok) }
.opt.wrong { border: 2px solid var(--red); background: var(--bad-bg) }
.opt.dim { opacity: .55 }
.opt:disabled { cursor: default; color: var(--ink) }
.conf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.conf button { height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 700 }
.conf button:last-child { background: var(--acc); color: var(--on-acc); border: 0 }
.rate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.rate button { height: 60px; border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1.5px solid var(--line) }
.rate button b { font-size: 15px } .rate button span { font-size: 12px; color: var(--muted) }
.rate .r1 { border-color: var(--red) } .rate .r2 { border-color: var(--warn) } .rate .r3 { border: 0; background: var(--ok); color: var(--on-acc) } .rate .r3 span { color: var(--on-acc) }

/* home */
.hero { background: var(--acc); color: var(--on-acc); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden }
.hero .deco1, .hero .deco2 { position: absolute; width: 120px; height: 84px; border-radius: 10px; pointer-events: none }
.hero .deco1 { right: -18px; top: 18px; background: rgba(255,255,255,.10); transform: rotate(8deg) }
.hero .deco2 { right: 2px; top: 30px; background: rgba(255,255,255,.16); transform: rotate(-4deg) }
.hero .chip { background: rgba(255,255,255,.16); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700 }
.hero a.go { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 14px; background: var(--on-acc); color: var(--acc); font-family: var(--display); font-weight: 700; font-size: 17px; text-decoration: none }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }

/* tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 12px calc(18px + env(safe-area-inset-bottom, 0px)) }
.tabs nav { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; position: relative }
.tabs a[aria-current="page"] { color: var(--acc) }
.tabs .dot { position: absolute; top: -2px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px }
.steps button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0 }
.steps .n { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700 }
.steps .l { font-size: 12px; color: var(--muted) }
.steps .on .n { background: var(--acc); border-color: var(--acc); color: var(--on-acc) } .steps .on .l { font-weight: 700; color: var(--ink) }
.steps .done .n { background: var(--ok-bg); border-color: var(--ok); color: var(--ok) }

/* flashcard */
.fc { position: relative; flex-grow: 1; display: flex; min-height: 380px; border: 0; background: none; padding: 0; text-align: left; width: 100% }
.fc .under { position: absolute; left: 14px; right: 14px; top: 14px; bottom: -10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transform: rotate(-2deg) }
.fc .face { position: relative; flex-grow: 1; background-color: var(--surface); background-image: repeating-linear-gradient(180deg, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px); border-radius: 18px; border-top: 6px solid var(--red); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 4px 16px rgba(24,33,58,0.08); animation: flipin .35s ease }
@keyframes flipin { from { transform: rotateY(70deg); opacity: .3 } to { transform: none; opacity: 1 } }
.fc .ans { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.36 }

/* diagnostic */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
.pbtn { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 700; text-align: left }
.pbtn .sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0 }
.pbtn[aria-pressed="true"] { border-width: 2px }

/* lists */
.lrow { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: 14px; padding: 16px; min-height: 64px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink) }
.num { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; font-size: 14px; color: var(--muted) }
.num.on { background: var(--acc); border-color: var(--acc); color: var(--on-acc) }
.num.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok) }
.drow { display: grid; grid-template-columns: 132px minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 13px }
.drow .bar { height: 8px }
.switch { width: 52px; height: 32px; border-radius: 999px; border: 0; background: var(--line); position: relative; padding: 0; flex-shrink: 0 }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); transition: left .15s }
.switch[aria-checked="true"] { background: var(--acc) } .switch[aria-checked="true"]::after { left: 23px }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg) }
.seg button { height: 34px; padding: 0 10px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700 }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow) }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; color: var(--on-acc) }
.code6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px }
.code6 input { height: 52px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); text-align: center; font-family: var(--display); font-size: 22px; font-weight: 700; width: 100% }
.code6 input:focus, .code6 input.f { border-color: var(--acc) }
.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 20; max-width: 90vw }
.answer { white-space: pre-wrap; line-height: 1.6 }

/* widgets (Exersează) */
.wpanel { background: var(--surface); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow) }
.ctrl { display: grid; grid-template-columns: minmax(110px, 150px) 1fr 52px; gap: 10px; align-items: center; font-size: 14px }
.ctrl output { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums }
input[type=range] { width: 100%; accent-color: var(--acc) }
.pbar { display: grid; grid-template-columns: 96px 1fr 48px; gap: 8px; align-items: center; font-size: 14px }
.pbar .track { height: 16px; background: var(--bg); border-radius: 5px; overflow: hidden } .pbar .fill { height: 100%; background: var(--acc); transition: width .2s }
.pbar.cut { opacity: .4 } .pbar.cut .w { text-decoration: line-through }
.chips { display: flex; flex-wrap: wrap; gap: 6px } .chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px }
.chip.hot { border-color: var(--red); color: var(--red) }
.blk { font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg) }
.blk.rule { border-color: var(--acc); color: var(--acc) } .blk.out { opacity: .35; border-style: dashed; text-decoration: line-through }
.cstep { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; background: var(--surface) }
.cstep.bad { border-color: var(--red); background: var(--bad-bg) } .cstep.fix { border-color: var(--ok); background: var(--ok-bg) }
.cstep .v { font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums }
.chain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
.srow { display: flex; flex-direction: column; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface) }
.srow.ok { border-color: var(--ok); background: var(--ok-bg) } .srow.no { border-color: var(--red); background: var(--bad-bg) }
.srow select { height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 10px }
.tile { border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 110px; width: 100% }
.tile.on { border-color: var(--acc); background: var(--sel) }
svg text { font-family: var(--body) }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }
@media (min-width: 700px) { .app { padding-top: 32px } .chain { grid-template-columns: repeat(4, minmax(0, 1fr)) } }

.fisa.plain { background-image: none }
.lesson-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px; border-radius: 12px; background: var(--bg); color: var(--ink); text-decoration: none; line-height: 1.35 }
.lesson-row:hover { color: var(--ink); outline: 1.5px solid var(--line) }
.lesson-row.cur { background: var(--sel); outline: 2px solid var(--acc) }
.ls-ic { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--acc); background: var(--surface) }
.ls-ic.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok) }

/* always-visible top bar on screens without the tab bar */
.sticky { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--bg); margin: -8px -20px 0; padding: 8px 20px; min-height: 60px; box-shadow: 0 1px 0 var(--line) }
.navbtn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px }
.navbtn:hover { color: var(--ink); border-color: var(--ink) }
