/* ============================================================================
   Chestionar Fiscalitate — Dark Luxury theme
   ==========================================================================*/

/* ------------------------------- fonts --------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/fonts/inter-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../vendor/fonts/jetbrainsmono-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../vendor/fonts/jetbrainsmono-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------- tokens -------------------------------- */
:root {
  color-scheme: dark;
  --bg-base: #0a0907;
  --bg-surface: #100f0d;
  --bg-card: #161412;
  --bg-footer: #141210;
  --border-subtle: rgba(255, 248, 230, 0.07);
  --border-medium: rgba(255, 248, 230, 0.13);
  --border-accent: rgba(212, 160, 60, 0.55);
  --text-primary: #f0ebe0;
  --text-body: #8a8070;
  --text-muted: #5a544a;
  --text-tertiary: #524c42;
  --accent: #d4a03c;
  --accent-bright: #e8b84e;
  --accent-glow: rgba(212, 160, 60, 0.18);
  --accent-subtle: rgba(212, 160, 60, 0.08);
  --success: #3d9e5c;
  --error: #b83c38;
  --success-tint: rgba(61, 158, 92, 0.1);
  --success-tint-strong: rgba(61, 158, 92, 0.12);
  --error-tint: rgba(184, 60, 56, 0.1);
  --error-tint-strong: rgba(184, 60, 56, 0.12);
  --success-border: rgba(61, 158, 92, 0.45);
  --error-border: rgba(184, 60, 56, 0.45);
  --on-success: #d8f0de;
  --on-error: #f0d8d6;
  --on-accent: #f5ead0;
  --edge-highlight: rgba(255, 248, 230, 0.08);
  --edge-highlight-strong: rgba(255, 248, 230, 0.1);
  --border-strong: rgba(255, 248, 230, 0.28);
  --hover-tint: rgba(255, 255, 255, 0.03);
  --scrim: rgba(10, 9, 7, 0.8);
  --backdrop: rgba(4, 4, 4, 0.65);
  --shadow-card: inset 0 1px 0 var(--edge-highlight), 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: inset 0 1px 0 var(--edge-highlight-strong), 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-modal: inset 0 1px 0 var(--edge-highlight), 0 24px 60px var(--backdrop);
  --glow-ambient: rgba(212, 160, 60, 0.12);
  --glow-strong: rgba(212, 160, 60, 0.55);
  --glow-mid: rgba(212, 160, 60, 0.25);
  --glow-soft: rgba(212, 160, 60, 0.1);
  --glow-ring: rgba(212, 160, 60, 0.75);
  --ring-strong: rgba(212, 160, 60, 0.7);
  --ring-mid: rgba(212, 160, 60, 0.4);
  --ring-soft: rgba(212, 160, 60, 0.35);
  --glow-hover: rgba(212, 160, 60, 0.18);
  --glow-pulse: rgba(212, 160, 60, 0.16);
  --orb-1: rgba(180, 100, 15, 0.28);
  --orb-2: rgba(150, 75, 10, 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-enter: 600ms;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-base: #f2ede3;
  --bg-surface: #f7f3ea;
  --bg-card: #fffdf9;
  --bg-footer: #f7f3ea;
  --border-subtle: rgba(60, 45, 20, 0.10);
  --border-medium: rgba(60, 45, 20, 0.18);
  --border-accent: rgba(138, 92, 16, 0.5);
  --border-strong: rgba(60, 45, 20, 0.28);
  --text-primary: #17130e;
  --text-body: #5a5145;
  --text-muted: #7d7365;
  --text-tertiary: #8c8273;
  --accent: #8a5c10;
  --accent-bright: #a8751a;
  --accent-glow: rgba(138, 92, 16, 0.14);
  --accent-subtle: rgba(138, 92, 16, 0.08);
  --success: #1f6b3d;
  --error: #a52a26;
  --success-tint: rgba(31, 107, 61, 0.10);
  --success-tint-strong: rgba(31, 107, 61, 0.14);
  --error-tint: rgba(165, 42, 38, 0.09);
  --error-tint-strong: rgba(165, 42, 38, 0.12);
  --success-border: rgba(31, 107, 61, 0.45);
  --error-border: rgba(165, 42, 38, 0.45);
  --on-success: #14512c;
  --on-error: #7d1f1c;
  --on-accent: #6b4a0d;
  --edge-highlight: rgba(255, 255, 255, 0.9);
  --edge-highlight-strong: #ffffff;
  --hover-tint: rgba(60, 45, 20, 0.04);
  --scrim: rgba(247, 243, 234, 0.82);
  --backdrop: rgba(40, 30, 15, 0.45);
  --shadow-card: inset 0 1px 0 #ffffff, 0 1px 2px rgba(60, 45, 20, 0.06), 0 8px 24px rgba(60, 45, 20, 0.07);
  --shadow-card-hover: inset 0 1px 0 #ffffff, 0 2px 4px rgba(60, 45, 20, 0.08), 0 16px 40px rgba(60, 45, 20, 0.11);
  --shadow-modal: inset 0 1px 0 #ffffff, 0 24px 60px var(--backdrop);
  --glow-ambient: rgba(138, 92, 16, 0.10);
  --glow-strong: rgba(138, 92, 16, 0.5);
  --glow-mid: rgba(138, 92, 16, 0.2);
  --glow-soft: rgba(138, 92, 16, 0.08);
  --glow-ring: rgba(138, 92, 16, 0.65);
  --ring-strong: rgba(138, 92, 16, 0.6);
  --ring-mid: rgba(138, 92, 16, 0.35);
  --ring-soft: rgba(138, 92, 16, 0.25);
  --glow-hover: rgba(138, 92, 16, 0.14);
  --glow-pulse: rgba(138, 92, 16, 0.12);
  --orb-1: rgba(200, 140, 40, 0.20);
  --orb-2: rgba(190, 130, 35, 0.08);
}

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

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-body);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-size: 128px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* single ambient orb */
body::after {
  content: '';
  position: fixed;
  left: 50%;
  bottom: -120px;
  width: 900px;
  height: 500px;
  transform: translateX(-50%);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at center bottom, var(--orb-1) 0%, var(--orb-2) 35%, transparent 70%);
  animation: orb-breathe 8s ease-in-out infinite alternate;
}

[data-theme="light"] body::before {
  opacity: 0.025;
  mix-blend-mode: multiply;
}

[data-theme="light"] body::after {
  opacity: 0.55;
}

@keyframes orb-breathe {
  from { opacity: 0.8; transform: translateX(-50%) scale(1); }
  to { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

/* ------------------------------- typography ---------------------------- */
h1,
h2,
h3,
h4,
strong {
  color: var(--text-primary);
  font-weight: 700;
}

h1 {
  font-size: clamp(32px, 4.5vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0.2rem 0 0.6rem;
}

h2 {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0.4rem 0 0.6rem;
}

h3 {
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 1rem 0 0.5rem;
}

h4 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0.4rem 0;
}

p {
  margin: 0.5rem 0;
}

code,
kbd {
  font-family: var(--font-mono);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-bright);
  text-decoration: underline;
}

/* ------------------------------- utilities ----------------------------- */
.section-label {
  display: block;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.sub {
  color: var(--text-body);
  margin-top: -0.2rem;
}

.titlu-sectiune {
  margin: 2rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* ------------------------------- inline icons -------------------------- */
.tag svg,
.feedback h3 svg,
.rezultat h4 svg,
.avertisment svg,
.capcane h3 svg,
.corect-inline svg,
.gresit-inline svg,
.btn[data-act="flag"] svg {
  display: inline-block;
  vertical-align: -0.18em;
  margin-right: 0.25em;
}

.tag svg {
  width: 14px;
  height: 14px;
}

.feedback h3 svg {
  width: 20px;
  height: 20px;
}

.rezultat h4 svg,
.capcane h3 svg {
  width: 18px;
  height: 18px;
}

.avertisment svg,
.corect-inline svg,
.gresit-inline svg {
  width: 16px;
  height: 16px;
}

.btn[data-act="flag"] svg {
  width: 14px;
  height: 14px;
}

.scor-live svg {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: -0.15em;
  margin-right: 0.2em;
}

.card-acc strong svg {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: -0.18em;
  margin-right: 0.25em;
}

/* ------------------------------- topbar -------------------------------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem clamp(1rem, 3vw, 2.5rem);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-base) ease, border-color var(--dur-base) ease, backdrop-filter var(--dur-base) ease;
}

.topbar.scrolled {
  background: var(--scrim);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom-color: var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.brand .logo svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.brand strong {
  display: block;
  font-size: 1rem;
  white-space: nowrap;
  color: var(--text-primary);
}

.brand small {
  display: block;
  color: var(--text-body);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  justify-content: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-body);
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease, border-color var(--dur-fast) ease;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--hover-tint);
}

.tab.activ {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--border-accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5px;
}

.icon-btn:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
}

/* ------------------------------- layout -------------------------------- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--topbar-h, 72px) + 24px) clamp(1rem, 3vw, 2.5rem) 5rem;
  min-width: 0;
}

#app {
  min-width: 0;
}

/* ------------------------------- cards --------------------------------- */
.card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease;
}

.card + .card {
  margin-top: 1rem;
}

/* ritm vertical consistent între blocuri (grid ↔ card), ca la `.card + .card` */
.card-uri + .card,
.card + .card-uri,
.card-uri + .card-uri {
  margin-top: 1rem;
}

/* În grid spațierea o dă deja `gap`; altfel `margin-top` de mai sus
   împinge cardurile 2..n în jos și strică alinierea pe rând.
   Selectorul trebuie să bată specificitatea lui `.card + .card`. */
.card-uri > *,
.card-uri > .card + .card,
.card-uri > * + * {
  margin-top: 0;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.card.featured {
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border-accent), 0 0 30px var(--glow-ambient);
}

.card-uri {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.card.stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 1.25rem 1.5rem;
}

.card.stat .val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.card.stat .eti {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.card.stat small {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* ------------------------------- hero ---------------------------------- */
.hero {
  padding: 1rem 0 0.5rem;
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-body);
  max-width: 720px;
}

.hero p strong,
.hero p em {
  color: var(--text-primary);
}

/* ------------------------------- shortcuts ----------------------------- */
.scurtaturi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.scurtatura {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  text-align: left;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  font: inherit;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease, border-color var(--dur-fast) ease;
}

.scurtatura:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover), 0 0 0 1px var(--border-accent), 0 0 30px var(--glow-ambient);
}

.scurtatura span {
  font-size: 1.5rem;
  line-height: 1;
}

.scurtatura strong {
  font-size: 1.05rem;
}

.scurtatura small {
  color: var(--text-body);
  font-size: 0.8rem;
}

.scurtatura > span {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  display: grid;
  place-items: center;
  color: var(--accent);
  margin-bottom: 4px;
}

.scurtatura > span svg {
  width: 20px;
  height: 20px;
}

/* ------------------------------- card-acc ------------------------------ */
.card-acc {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
  cursor: pointer;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  color: var(--text-primary);
  font: inherit;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease;
}

.card-acc:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover), 0 0 0 1px var(--border-accent), 0 0 30px var(--glow-ambient);
}

.card-acc strong {
  font-size: 1.05rem;
}

.card-acc span {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.card-acc small {
  color: var(--text-body);
  font-size: 0.8rem;
}

.lista-examene {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .lista-examene {
    grid-template-columns: 1fr 1fr;
  }

  .card-acc.wide {
    grid-column: span 2;
  }
}

/* ------------------------------- chips --------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.3rem 0 1rem;
}

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.chip:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--hover-tint);
}

.chip.activ {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--border-accent);
}

/* ------------------------------- buttons ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: box-shadow var(--dur-base) ease, border-color var(--dur-base) ease, transform var(--dur-fast) var(--ease-out), background var(--dur-fast) ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:not(.ghost):not(.danger):not(.bun):not(.mediu):not(.rau):not(.foarte-bun) {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--glow-strong), 0 0 20px var(--glow-mid), 0 0 40px var(--glow-soft);
  animation: btn-pulse 2.8s ease-in-out infinite;
}

.btn:not(.ghost):not(.danger):not(.bun):not(.mediu):not(.rau):not(.foarte-bun):hover {
  animation: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 10px var(--glow-ring), 0 0 28px var(--ring-mid), 0 0 55px var(--glow-hover);
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 0 8px var(--glow-strong), 0 0 20px var(--glow-mid), 0 0 40px var(--glow-soft); }
  50% { box-shadow: 0 0 10px var(--ring-strong), 0 0 28px var(--ring-soft), 0 0 52px var(--glow-pulse); }
}

[data-theme="light"] .btn:not(.ghost):not(.danger):not(.bun):not(.mediu):not(.rau):not(.foarte-bun) {
  box-shadow: 0 0 0 1px var(--border-accent), 0 1px 2px rgba(60, 45, 20, 0.08);
  animation: none;
}

[data-theme="light"] .btn:not(.ghost):not(.danger):not(.bun):not(.mediu):not(.rau):not(.foarte-bun):hover {
  box-shadow: 0 0 0 1px var(--accent-bright), 0 2px 6px rgba(60, 45, 20, 0.10);
}

.btn.ghost {
  border-color: var(--border-medium);
}

.btn.ghost:hover {
  border-color: var(--border-strong);
  background: var(--hover-tint);
}

.btn.danger {
  border-color: var(--error);
  color: var(--on-error);
}

.btn.danger:hover {
  background: var(--error-tint-strong);
}

.btn.bun {
  border-color: var(--success);
  color: var(--on-success);
}

.btn.bun:hover {
  background: var(--success-tint-strong);
}

.btn.mediu {
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn.mediu:hover {
  background: var(--accent-subtle);
}

.btn.rau {
  border-color: var(--error);
  color: var(--on-error);
}

.btn.rau:hover {
  background: var(--error-tint-strong);
}

.btn.foarte-bun {
  border-color: var(--accent-bright);
  color: var(--on-accent);
}

.btn.foarte-bun:hover {
  background: var(--accent-subtle);
}

.set-tema.activ {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--border-accent);
}

.btn.mare {
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
}

.btn.mic {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.actiuni {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}

.actiuni.note {
  align-items: center;
}

.actiuni.note .eticheta {
  color: var(--text-body);
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 0.25rem;
}

/* ------------------------------- session bar --------------------------- */
.bara-sesiune {
  padding: 1.25rem 1.5rem;
}

.bara-sesiune .linia1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.bara-sesiune .linia1 strong {
  color: var(--text-primary);
}

.bara-sesiune .counter {
  color: var(--text-body);
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
  font-family: var(--font-mono);
}

.bara-sesiune .scor-live {
  color: var(--success);
  font-weight: 700;
  font-size: 0.86rem;
}

.cronometru {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border-accent);
}

.bara-sesiune .btn {
  margin-left: auto;
}

.bar {
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
  height: 9px;
  margin-top: 0.5rem;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--ring-soft);
  transition: width 0.3s ease;
}

.bar.subtire {
  height: 5px;
  margin-top: 0.5rem;
}

/* ----------------------------- question card --------------------------- */
.intrebare,
.card,
.card-acc,
.scurtatura {
  min-width: 0;
}

.enunt {
  overflow-wrap: anywhere;
}

.intrebare .meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.tag.tema {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-subtle);
}

.tag.test {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.tag.d1 {
  color: var(--success);
  border-color: var(--success-border);
}

.tag.d2 {
  color: var(--accent);
  border-color: var(--border-accent);
}

.tag.d3 {
  color: var(--error);
  border-color: var(--error-border);
}

.tag.sub {
  color: var(--text-tertiary);
}

.enunt {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0.3rem 0 1rem;
  color: var(--text-primary);
}

.avertisment {
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.variante {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.varianta {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out), background var(--dur-fast) ease;
}

.varianta:hover {
  border-color: var(--border-accent);
  transform: translateX(2px);
}

.varianta > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
}

.varianta .litera {
  font-weight: 800;
  color: var(--accent);
  min-width: 1.4rem;
  flex: 0 0 auto;
}

.varianta.corecta {
  background: var(--success-tint);
  border-color: var(--success);
  box-shadow: inset 3px 0 0 var(--success);
}

.varianta.corecta .litera {
  color: var(--success);
}

.varianta.aleasa-gresit {
  background: var(--error-tint);
  border-color: var(--error);
  box-shadow: inset 3px 0 0 var(--error);
}

.varianta.aleasa-gresit .litera {
  color: var(--error);
}

.varianta.stinsa {
  opacity: 0.5;
}

.varianta.stinsa:hover {
  transform: none;
  border-color: var(--border-subtle);
}

.hint-tastatura {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  margin-top: 0.75rem;
}

kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05rem 0.35rem;
  font-size: 0.75rem;
  color: var(--text-primary);
}

/* ------------------------------- feedback ------------------------------ */
.feedback {
  margin-top: 1rem;
  border-left: 3px solid var(--accent);
}

.feedback.ok {
  border-left-color: var(--success);
}

.feedback.rau {
  border-left-color: var(--error);
}

.feedback h3 {
  margin-top: 0;
}

.feedback.ok h3 {
  color: var(--success);
}

.feedback.rau h3 {
  color: var(--error);
}

.ai-ales {
  background: var(--error-tint);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
}

.ai-ales p,
.explic-corect p {
  margin: 0.15rem 0;
}

.varianta-aleasa {
  font-weight: 700;
  color: var(--error);
}

.varianta-corecta {
  font-weight: 700;
  font-size: 1rem;
  color: var(--success);
}

.explic-text {
  margin-top: 0.5rem !important;
}

.eticheta {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  margin-bottom: 0.2rem;
}

.explic-gresit {
  background: var(--error-tint);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 0.6rem 0;
  font-size: 0.92rem;
}

.explic-corect {
  background: var(--success-tint);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 0.6rem 0;
  font-size: 0.92rem;
}

.formula {
  background: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 0.6rem 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

/* ------------------------------- KaTeX --------------------------------- */
.katex {
  font-size: 1.05em;
  color: var(--text-primary);
}

.katex-bloc {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0;
  -webkit-overflow-scrolling: touch;
}

.katex-bloc .katex-display {
  margin: 0.15rem 0;
}

.katex-bloc::-webkit-scrollbar {
  height: 6px;
}

.katex-bloc::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-pill);
}

.katex-fallback {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  white-space: pre-wrap;
  color: var(--text-body);
}

.formula .katex-fallback {
  color: var(--text-body);
}

.formula-mica {
  color: var(--accent);
  margin: 0.4rem 0;
}

.formula-mica .katex {
  font-size: 0.95em;
}

.varianta .katex,
.lista-explicatii .katex {
  font-size: 1em;
}

.formula-item .katex-bloc {
  width: 100%;
}

details.toate {
  margin-top: 0.8rem;
}

details.toate summary {
  cursor: pointer;
  color: var(--text-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0;
}

details.toate summary:hover {
  color: var(--accent);
}

.lista-explicatii {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lista-explicatii li {
  font-size: 0.86rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border-left: 3px solid var(--text-tertiary);
}

.lista-explicatii li.bun {
  border-left-color: var(--success);
}

.lista-explicatii li.rau {
  border-left-color: var(--error);
}

.lista-explicatii li strong {
  color: var(--text-primary);
}

.feedback-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-subtle);
}

.sursa {
  color: var(--text-tertiary);
  font-size: 0.74rem;
}

/* ------------------------------- navigator ----------------------------- */
.navigator {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.punct {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.punct:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.punct.raspuns {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--border-accent);
}

.punct.curent {
  outline: 2px solid var(--accent-bright);
  outline-offset: 1px;
}

/* ------------------------------- result -------------------------------- */
.rezultat {
  text-align: center;
}

.rezultat h2 {
  margin-bottom: 0.5rem;
}

.mesaj {
  color: var(--text-body);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.nota-mare {
  font-size: 1.1rem;
  color: var(--text-body);
}

.nota-mare strong {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  display: block;
}

.stats-mici {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  color: var(--text-body);
  font-size: 0.8rem;
}

.stats-mici span {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.recap {
  margin: 0.5rem 0;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--error);
}

.recap summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.recap p {
  font-size: 0.86rem;
  margin: 0.4rem 0;
}

.corect-inline {
  color: var(--success);
}

.gresit-inline {
  color: var(--error);
}

.formula-mica {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
}

.lista-bune {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.lista-bune li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.86rem;
  color: var(--text-body);
}

.lista-bune li:last-child {
  border-bottom: none;
}

/* ------------------------------- table themes -------------------------- */
.tabel .grup {
  margin: 1.25rem 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.tabel .grup:first-child {
  margin-top: 0;
}

.linie-tema {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.linie-tema:last-child {
  border-bottom: none;
}

.linie-tema .stanga {
  flex: 1;
  min-width: 200px;
}

.linie-tema .stanga strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.linie-tema .stanga small {
  display: block;
  color: var(--text-tertiary);
  font-size: 0.78rem;
}

.linie-tema .dreapta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rată {
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.rată.bun {
  color: var(--success);
}

.rată.mediu {
  color: var(--accent);
}

.rată.slab {
  color: var(--error);
}

.rată.gri {
  color: var(--text-tertiary);
}

.acop {
  color: var(--text-tertiary);
  font-size: 0.78rem;
}

/* ------------------------------- theory -------------------------------- */
.teorie h2 {
  margin-top: 0;
}

.sect {
  margin: 1.25rem 0;
  padding-top: 0.25rem;
}

.sect h3 {
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.sect .text {
  color: var(--text-body);
  font-size: 0.95rem;
}

.formule {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.formula-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.formula-item code {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.formula-item .explic {
  color: var(--text-body);
  font-size: 0.82rem;
}

.capcane {
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.capcane h3 {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.capcane ul {
  margin: 0;
  padding-left: 1.1rem;
}

.capcane li {
  font-size: 0.88rem;
  margin: 0.3rem 0;
  color: var(--text-body);
}

/* ------------------------------- statistics ---------------------------- */
.lista-probleme {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lista-probleme li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-body);
}

.lista-probleme li:last-child {
  border-bottom: none;
}

.badge-rau {
  background: var(--error-tint-strong);
  color: var(--error);
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  margin-right: 0.4rem;
}

.tabel-sesiuni {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.tabel-sesiuni th {
  text-align: left;
  color: var(--text-tertiary);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
}

.tabel-sesiuni td {
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
}

.tabel-sesiuni tr:last-child td {
  border-bottom: none;
}

/* ------------------------------- toast --------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 140%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.25rem;
  font-size: 0.86rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-card-hover);
  transition: transform 0.25s var(--ease-out), opacity 0.25s ease, visibility 0s linear 0.25s;
  z-index: 200;
  max-width: 88vw;
  text-align: center;
}

.toast:empty {
  display: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.25s var(--ease-out), opacity 0.25s ease, visibility 0s;
}

.toast.bun {
  border-color: var(--success);
}

.toast.rau {
  border-color: var(--error);
}

/* ------------------------------- modal --------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none;
}

[hidden] {
  display: none !important;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: inset 0 1px 0 var(--edge-highlight), 0 24px 60px var(--backdrop);
}

.modal h3 {
  margin-top: 0;
}

.modal hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1.25rem 0;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.4rem 0;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text-body);
}

.check input {
  margin-top: 0.25rem;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* ------------------------------- focus --------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.btn:focus-visible,
.chip:focus-visible,
.tab:focus-visible,
.punct:focus-visible,
.scurtatura:focus-visible,
.card-acc:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* ------------------------------- reduced motion ------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body::after {
    animation: none;
  }
}

/* ------------------------------- responsive ---------------------------- */
@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .topbar-right {
    order: 2;
    flex: 0 0 auto;
  }

  .tabs {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  h1 {
    font-size: 1.75rem;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  main {
    padding: calc(var(--topbar-h, 132px) + 16px) 1rem 4rem;
  }

  .tab {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    flex: 0 0 auto;
  }

  .linie-tema .stanga {
    min-width: 0;
  }

  .linie-tema .dreapta {
    width: 100%;
  }

  .card {
    padding: 1.1rem 1rem;
  }

  .stats-mici {
    gap: 1rem;
  }

  .punct {
    width: 29px;
    height: 29px;
  }

  .lista-examene {
    grid-template-columns: 1fr;
  }

  .card-acc.wide {
    grid-column: auto;
  }
}
