/* Stil comun: culori, text, antet cu cont, butoane, câmpuri, ferestre.
   O singură temă deschisă și curată; toate paginile (magazin, platformă) o folosesc. */
:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --line: #e4e5e8;
  --line-strong: #cfd2d8;
  --ink: #151922;
  --ink-2: #2d3340;
  --muted: #5b6372;
  --brand: #1f56a5;
  --brand-dark: #173f7c;
  --brand-soft: #eaf0f9;
  --ok: #15803d;
  --ok-bg: #eaf8ef;
  --ok-line: #86d3a3;
  --bad: #b42318;
  --bad-bg: #fdeeed;
  --bad-line: #f1a39b;
  --warn-bg: #fff8e1;
  --warn-line: #efd488;
  --warn-ink: #5c4300;
  /* spațiere: 4 8 12 16 24 32 48 64 96 */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --radius: 16px;
  --btn-h: 44px;
  --head-h: 64px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 2px rgba(21, 25, 34, .04);
  --shadow-hover: 0 10px 24px rgba(21, 25, 34, .08);
  --font: 'Onest', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  background: var(--bg); color: var(--ink);
  min-height: 100vh; padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { letter-spacing: -.02em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -64px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); z-index: 200; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }

/* ---------------------------------------------------------------- antet */
.site-head { position: sticky; top: 0; z-index: 60; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head .wrap { height: var(--head-h); display: flex; align-items: center; gap: var(--s-5); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 16px; letter-spacing: -.01em; min-width: 0; flex: none; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; flex: none; }
.brand .mark svg { width: 18px; height: 18px; display: block; }
.brand b { font-weight: 650; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: var(--s-5); margin-left: var(--s-3); min-width: 0; }
.nav a, .navp a {
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; padding: 6px 0;
  background: linear-gradient(currentColor, currentColor) 100% 100% / 0 1px no-repeat; transition: background-size .15s var(--ease), color .15s;
}
.nav a:hover, .navp a:hover { color: var(--ink); background-position: 0 100%; background-size: 100% 1px; }
.nav a[aria-current="page"] { color: var(--ink); background: linear-gradient(var(--brand), var(--brand)) 0 100% / 100% 2px no-repeat; }
.head-end { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; place-items: center; color: var(--ink); }
.nav-toggle:hover { background: var(--bg); }
.nav-toggle svg { width: 22px; height: 22px; }
.navp { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--s-2) var(--gutter) var(--s-4); flex-direction: column; }
.navp.open { display: flex; }
.navp a { font-size: 17px; padding: 16px 0; border-bottom: 1px solid var(--line); background: none; }
.navp a:last-child { border-bottom: 0; }
@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }
  .head-end { margin-left: auto; }
}
@media (max-width: 420px) { .brand b span { display: none; } }

/* cerculețul de cont */
.acct { position: relative; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; padding: 2px; display: grid; place-items: center; }
.av {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: 15px; letter-spacing: .01em; border: 1px solid var(--line-strong);
  transition: border-color .15s, box-shadow .15s;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av svg { width: 20px; height: 20px; color: var(--muted); }
.av.out { background: var(--surface); }
.avatar:hover .av, .avatar[aria-expanded="true"] .av { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 32px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-2); display: none; box-shadow: var(--shadow-hover); z-index: 80;
}
.menu.open { display: block; animation: drop .15s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu-who { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3); }
.menu-who .av { width: 48px; height: 48px; font-size: 18px; }
.menu-who div { min-width: 0; }
.menu-who b { display: block; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.menu-who div span { display: block; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-2) 0; }
.menu a, .menu button.mi {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px var(--s-3); border: 0; background: transparent;
  border-radius: var(--r-md); text-decoration: none; color: var(--ink-2); font-size: 15px; font-weight: 500; text-align: left;
}
.menu a:hover, .menu button.mi:hover { background: var(--bg); color: var(--ink); }
.menu svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.menu-note { padding: var(--s-2) var(--s-3) var(--s-3); font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- butoane */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 var(--s-5);
  border: 1px solid var(--brand); border-radius: var(--r-md); background: var(--brand); color: #fff; font-weight: 600; font-size: 16px;
  text-decoration: none; text-align: center; line-height: 1.2; transition: background .15s var(--ease), border-color .15s, transform .15s var(--ease), color .15s;
}
.btn.ghost, .btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 36px; padding: 0 var(--s-4); font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .btn:not([disabled]):hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-1px); }
  .btn.ghost:not([disabled]):hover, .btn.secondary:not([disabled]):hover { background: var(--surface); border-color: var(--ink); color: var(--ink); }
}
.btn:not([disabled]):active { transform: translateY(1px) scale(.985); transition-duration: .09s; }
.btn-row { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.link { background: none; border: 0; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; padding: 8px 0; }
.link:hover { color: var(--brand-dark); }

/* ---------------------------------------------------------------- câmpuri */
label.f { display: block; font-size: 14px; font-weight: 500; margin: 0 0 var(--s-4); color: var(--ink); }
label.f input, input.in {
  display: block; width: 100%; min-height: 48px; margin-top: 6px; padding: 0 var(--s-4); border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; transition: border-color .14s, box-shadow .14s;
}
label.f input::placeholder, input.in::placeholder { color: #8d95a3; }
label.f input:focus, input.in:focus, .answer-row input:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px var(--brand-soft); }
.msg { border-radius: var(--r-md); padding: 10px 14px; font-size: 14px; margin-bottom: var(--s-3); }
.msg.err { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); }
.msg.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok); }
.msg.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }

/* ---------------------------------------------------------------- ferestre */
.ovl { position: fixed; inset: 0; background: rgba(21, 25, 34, .5); display: none; align-items: center; justify-content: center; z-index: 300; padding: var(--s-4); }
.ovl.open { display: flex; }
.dlg { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; padding: var(--s-5); }
.dlg h2 { font-size: 22px; font-weight: 650; margin-bottom: var(--s-1); }
.dlg .sub { color: var(--muted); font-size: 15px; margin-bottom: var(--s-4); }
.photo-row { display: flex; align-items: center; gap: var(--s-4); margin: var(--s-4) 0 var(--s-5); }
.photo-row .av { width: 88px; height: 88px; font-size: 32px; }
.photo-row .btns { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; font-weight: 500; padding: 10px 20px; border-radius: 50px; z-index: 400; font-size: 14px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: sp .8s linear infinite; margin: 40px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* bifă cu text (profil) și mărimi de cerc de profil */
.chk { display: flex; gap: var(--s-3); align-items: flex-start; margin: 0 0 var(--s-4); font-size: 15px; cursor: pointer; }
.chk input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.chk small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; line-height: 1.4; }
.av.sm { width: 36px; height: 36px; font-size: 13px; }
.av.xl { width: 72px; height: 72px; font-size: 26px; }

/* clopoțelul de notificări (lângă cercul de profil) */
.bellw { position: relative; }
.bell { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); display: grid; place-items: center; transition: background .15s, color .15s; }
.bell:hover, .bell[aria-expanded="true"] { background: var(--bg); color: var(--ink); }
.bell-ic svg { width: 23px; height: 23px; display: block; }
.bell-n { position: absolute; top: 1px; right: -1px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 15px; text-align: center; border: 2px solid var(--surface); box-sizing: border-box; font-variant-numeric: tabular-nums; }
.bell-n[hidden] { display: none; }
.bell-pop { position: absolute; right: -50px; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-hover); z-index: 80; display: none; }
.bell-pop.open { display: block; animation: drop .15s var(--ease); }
@media (max-width: 560px) { .bell-pop { position: fixed; left: 16px; right: 16px; top: calc(var(--head-h) + 8px); width: auto; } }
.bell-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.bell-h b { font-size: 15.5px; font-weight: 650; } .bell-h .link { padding: 0; font-size: 13px; }
.bell-l { list-style: none; }
.nt { display: flex; gap: var(--s-3); width: 100%; text-align: left; padding: var(--s-3) var(--s-4); background: none; border: 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.bell-l li:last-child .nt { border-bottom: 0; }
.nt:hover { background: var(--bg); }
.nt .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: transparent; }
.nt.unread { background: var(--brand-soft); } .nt.unread:hover { background: #dfe9f7; } .nt.unread .dot { background: var(--brand); }
.nt-b { min-width: 0; display: block; }
.nt-b b { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.3; }
.nt-b span { display: block; font-size: 14px; color: var(--ink-2); margin-top: 1px; overflow-wrap: anywhere; }
.nt-b small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.bell-e { padding: var(--s-5) var(--s-4); font-size: 14.5px; color: var(--muted); line-height: 1.5; }
