:root {
  --primary: #ea0029;   /* rosu EOS (color1) */
  --bg: #31171f;        /* bordo (color3) */
  --accent: #2f7c85;    /* teal (color4) */
  --white: #ffffff;
  --page: #f3f3f5;
  --text: #1f1f24;
  --muted: #6f6f7a;
  --line: #e6e6ea;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
[hidden] { display: none !important; }
.app { min-height: 100vh; max-width: 680px; margin: 0 auto; background: var(--bg); }
.app.light { background: var(--page); }
.loading { display: flex; align-items: center; justify-content: center; height: 70vh; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,0.2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
.light .spinner { border-color: var(--line); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* ---------- Butoane / campuri ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--primary); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 600; font-size: 15px; }
.btn:active { transform: scale(0.98); }
.btn.secondary { background: #fff; color: var(--bg); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--muted); padding: 8px 10px; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.field { margin: 12px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { min-height: 90px; resize: vertical; }
.error { color: var(--primary); font-size: 14px; margin: 8px 0; }

/* ---------- Onboarding / confirmare ---------- */
.onboard { padding: 28px 22px calc(28px + var(--safe-b)); min-height: 100vh; display: flex; flex-direction: column; justify-content: center; color: #fff; }
.onboard .hero { text-align: center; margin-bottom: 16px; }
.onboard .hero img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 14px 40px rgba(0,0,0,0.45); }
.onboard h1 { margin: 14px 0 2px; font-size: 26px; }
.onboard .tag { color: var(--primary); font-weight: 700; font-size: 15px; }
.onboard .card { background: #fff; color: var(--text); border-radius: 16px; padding: 18px; }
.onboard .card h2 { margin: 0 0 4px; font-size: 18px; }
.onboard .note { color: rgba(255,255,255,0.7); font-size: 13px; text-align: center; margin-top: 14px; }
.code-input { font-size: 30px; letter-spacing: 10px; text-align: center; font-weight: 700; }

/* ---------- Home (ecranul principal, stil LineUpr) ---------- */
.home { padding-bottom: calc(10px + var(--safe-b)); }
.home .header-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #fff; }
.home .header-fallback { aspect-ratio: 16 / 9; background: linear-gradient(160deg, var(--accent) 0 18%, #fff 18% 82%, var(--bg) 82%); display: flex; align-items: center; justify-content: center; }
.home .header-fallback b { font-size: 26px; color: var(--bg); }
.home .header-fallback b span { color: var(--primary); }
.menu { list-style: none; margin: 0; padding: 10px 0 0; }
.menu li a { display: flex; align-items: center; gap: 18px; padding: 16px 22px; color: #fff; }
.menu li a:active { background: rgba(255,255,255,0.06); }
.menu .ico { flex: 0 0 34px; width: 34px; height: 34px; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.menu .ico svg { width: 26px; height: 26px; fill: currentColor; }
.menu .t { font-size: 18px; font-weight: 500; line-height: 1.2; }
.menu .s { color: var(--primary); font-size: 14px; margin-top: 2px; }
.menu .badge { margin-left: auto; background: var(--primary); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; }
.home .footer-img { display: block; width: 100%; margin-top: 14px; }
.banner { margin: 10px 14px 0; background: #fff; color: var(--text); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.banner .bico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.banner .bico svg { width: 20px; height: 20px; fill: currentColor; }
.banner b { display: block; font-size: 15px; }
.banner .muted { font-size: 13px; }
.banner .grow { flex: 1; min-width: 0; }
.banner .acts { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.banner .acts button { background: transparent; border: 0; color: var(--primary); font-weight: 700; font-size: 13px; padding: 4px 6px; }
.banner .acts button.dim { color: var(--muted); font-weight: 500; }
.home-top { position: relative; }
.home .bell { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; background: rgba(49,23,31,0.85); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; }
.home .bell svg { width: 20px; height: 20px; fill: currentColor; }
.home .bell .n { position: absolute; top: -4px; right: -4px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }

/* ---------- Bara de navigare (pagini interioare) ---------- */
.navbar { position: sticky; top: 0; z-index: 10; background: #fff; color: var(--bg); display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) 8px 8px; border-bottom: 1px solid var(--line); }
.navbar .back { width: 40px; height: 40px; border: 0; background: transparent; color: var(--bg); display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.navbar .back svg { width: 24px; height: 24px; fill: currentColor; }
.navbar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar .act { width: 40px; height: 40px; border: 0; background: transparent; color: var(--bg); display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 22px; }
.navbar .act.on { color: var(--primary); }
.page { padding: 12px 14px calc(24px + var(--safe-b)); }
.page h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 18px 0 8px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- Liste ---------- */
.list { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--text); position: relative; }
.row:first-child { border-top: 0; }
.row:active { background: #fafafa; }
.row .thumb { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .thumb.icon img { width: 60%; height: 60%; object-fit: contain; }
.row .thumb.sq { border-radius: 10px; }
.row .thumb.ini { background: var(--primary); color: #fff; font-weight: 700; font-size: 16px; border: 0; }
.row .body { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 15px; line-height: 1.25; }
.row .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.row .chev { color: #c5c5cc; font-size: 20px; }
.row .heart { background: transparent; border: 0; font-size: 22px; color: #c5c5cc; padding: 6px; line-height: 1; }
.row .heart.on { color: var(--primary); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.time-head { font-weight: 700; font-size: 15px; margin: 16px 2px 6px; color: var(--text); }
.search { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 10px; outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Detaliu entitate ---------- */
.ehead { background: var(--bg); color: #fff; padding: 18px 18px 20px; display: flex; gap: 14px; align-items: center; }
.ehead .thumb { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ehead .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ehead .thumb.icon img { width: 60%; height: 60%; object-fit: contain; }
.ehead .thumb.sq { border-radius: 12px; }
.ehead h1 { margin: 0; font-size: 20px; line-height: 1.25; }
.ehead .sub { color: rgba(255,255,255,0.75); font-size: 14px; margin-top: 4px; }
.ehead .sub b { color: var(--primary); }
.ehero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #ddd; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.kv { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv:first-child { border-top: 0; }
.kv .k { flex: 0 0 90px; color: var(--muted); font-size: 13px; padding-top: 2px; }
.html { line-height: 1.5; word-wrap: break-word; }
.html ul, .html ol { padding-left: 20px; }
.html img { max-width: 100%; height: auto; border-radius: 8px; }
.html a { text-decoration: underline; }
.desc { white-space: pre-line; }

/* ---------- Chestionare ---------- */
.poll-opt { display: block; width: 100%; text-align: left; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin: 6px 0; position: relative; overflow: hidden; }
.poll-opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(234, 0, 41, 0.14); transition: width 0.4s; }
.poll-opt .lbl { position: relative; display: flex; justify-content: space-between; gap: 8px; }
.poll-opt.mine { border-color: var(--primary); }
.poll-opt.mine .lbl::before { content: "\2713 "; color: var(--primary); }
.stars { display: flex; gap: 6px; margin: 8px 0; }
.stars button { background: transparent; border: 0; font-size: 34px; color: #d6d6dc; padding: 0 2px; line-height: 1; }
.stars button.on { color: #ffb400; }
.pill { display: inline-block; background: #f0f0f3; color: var(--muted); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.pill.open { background: rgba(52,199,123,0.15); color: #1f8f55; }
.pill.closed { background: rgba(234,0,41,0.12); color: var(--primary); }

/* ---------- Q&A ---------- */
.q { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.q .vote { flex: 0 0 auto; background: #fff; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 700; min-width: 48px; text-align: center; }
.q .vote.on { border-color: var(--primary); color: var(--primary); }
.q .author { color: var(--muted); font-size: 12px; }
.q.answered .vote { border-color: #1f8f55; color: #1f8f55; }
.qform { display: flex; gap: 8px; margin: 8px 0; }
.qform input { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

/* ---------- Sheet / toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; background: #fff; color: var(--text); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; max-width: 680px; margin: 0 auto; animation: up 0.22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; background: #ddd; border-radius: 2px; margin: 10px auto 4px; }
.sheet-body { overflow-y: auto; padding: 8px 18px calc(24px + var(--safe-b)); }
.sheet-body h2 { margin: 8px 0 4px; font-size: 20px; }
.sheet-close { position: absolute; top: 10px; right: 14px; background: #f0f0f3; color: var(--text); border: 0; border-radius: 50%; width: 32px; height: 32px; font-size: 18px; }
.steps { margin: 10px 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.steps .n { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.share-ico { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); background: #1f1f24; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 40; box-shadow: 0 8px 24px rgba(0,0,0,0.4); max-width: 90vw; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.status-dot.on { background: #1f8f55; }
.status-dot.off { background: var(--primary); }
