/* Stiluri de bază: fonturi locale, culori, bara de sus, intrarea, panoul de detaliu, mesajul de jos. */

@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F3F5F1;
  --surface: #FFFFFF;
  --surface-2: #F8FAF7;
  --ink: #14201B;
  --muted: #56625A;
  --line: #DDE3DC;
  --line-2: #EDF0EC;
  --pine: #0F2A22;
  --pine-2: #1A3B30;
  --blue: #2F68AE;
  --blue-bg: #EAF1FB;
  --ok: #1E5E3B;
  --ok-bg: #E3F1E8;
  --warn: #7A4A0B;
  --warn-bg: #FCEFD9;
  --bad: #A61E28;
  --bad-bg: #FBE7E8;
  /* tema închisă, pentru Check-in */
  --d-bg: #0E1A16;
  --d-surface: #16261F;
  --d-surface-2: #1C3028;
  --d-line: #2C463B;
  --d-ink: #EEF3EF;
  --d-muted: #A3B4AA;
  --d-ok: #4CC98A;
  /* pastila RBC / WIN: plină pentru RBC, doar contur pentru WIN */
  --org-solid: #0F2A22;
  --org-on: #F4F7F3;
  --org-line: #0F2A22;
  --org-text: #0F2A22;
  --display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.is-dark { background: var(--d-bg); color: var(--d-ink); color-scheme: dark; }
body.has-sheet { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.is-dark :focus-visible, .dark :focus-visible, .top :focus-visible { outline-color: #7FB2F0; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ic { flex: none; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }
.meta { font-size: 13px; color: var(--muted); }
.dark .meta { color: var(--d-muted); }
.empty-msg { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 15px; }
.is-dark .empty-msg, .dark .empty-msg { color: var(--d-muted); }

/* Globul: culoarea mesei. Alb are contur fin. */
.glob { --s: 28px; width: var(--s); height: var(--s); border-radius: 50%; background: var(--tc, #C7CEC9); position: relative; flex: none; display: inline-block; }
.glob::before { content: ''; position: absolute; left: 50%; top: calc(var(--s) * -0.14); width: calc(var(--s) * 0.26); height: calc(var(--s) * 0.18); margin-left: calc(var(--s) * -0.13); border-radius: 1px; background: #B9A980; }
.glob::after { content: ''; position: absolute; left: 22%; top: 20%; width: 22%; height: 22%; border-radius: 50%; background: rgba(255, 255, 255, 0.4); }
.glob.light { border: 1px solid #AEB8B1; }
.glob.none { background: transparent; border: 1.5px dashed #8A968F; }
.glob.none::before, .glob.none::after { display: none; }
.glob.big { --s: 72px; }

/* Pastila RBC / WIN: organizatorul invitatului sau al mesei. Fără culori noi: culoarea rămâne doar pentru globuri. */
.org { display: inline-flex; align-items: center; flex: none; height: 20px; padding: 0 8px; border: 1px solid var(--org-solid); border-radius: 999px; background: var(--org-solid); color: var(--org-on); font-family: var(--body); font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0.04em; white-space: nowrap; vertical-align: middle; }
.org-win { border-color: var(--org-line); background: transparent; color: var(--org-text); }
/* Pe fundal deschis (panoul luminos și cutia mesei) pastila e verde-brad; pe fundal închis e deschisă. */
.sheet, .dark .tbox { --org-solid: #0F2A22; --org-on: #F4F7F3; --org-line: #0F2A22; --org-text: #0F2A22; }
.is-dark, .sheet.dark { --org-solid: #F4F7F3; --org-on: #14201B; --org-line: #A3B4AA; --org-text: #EEF3EF; }

/* Bara de sus */
.topwrap { position: sticky; top: 0; z-index: 40; }
.top { background: var(--pine); color: #F4F7F3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 64px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
.brand { flex: 1 1 0; min-width: 0; }
.brand b { display: block; font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; background: var(--pine-2); padding: 4px; border-radius: 12px; overflow-x: auto; }
.tab { border-radius: 8px; padding: 0 16px; min-height: 40px; display: inline-flex; align-items: center; color: #DCE6DF; font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap; }
.tab[aria-current="page"] { background: #F4F7F3; color: var(--pine); font-weight: 700; }
.top-r { display: flex; align-items: center; gap: 12px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #CFE0D5; white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #8A968F; flex: none; }
.status.live i { background: #4CC98A; }
.status.off i { background: #E6B04A; }
.top-btn { min-height: 48px; min-width: 48px; padding: 0 12px; border: 1px solid #2C463B; border-radius: 12px; background: transparent; color: #DCE6DF; font-size: 15px; font-weight: 500; }
.netbar { background: #F3D99A; color: #3A2A06; font-size: 14px; font-weight: 600; text-align: center; padding: 8px 16px; }
@media (max-width: 640px) {
  .tabs { order: 3; flex: 1 1 100%; }
  .tab { flex: 1; justify-content: center; }
}

/* Intrarea: un singur câmp mare și un buton */
.gate { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.gate-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.gate-card h1 { font-size: 30px; line-height: 1.1; margin-bottom: 8px; }
.gate-card label { font-size: 15px; font-weight: 600; margin-bottom: -8px; }
.gate-card input { width: 100%; height: 56px; padding: 0 16px; border: 1px solid #C2CBC3; border-radius: 12px; background: var(--surface); font-size: 20px; }
.gate-card input:focus { outline: 2px solid var(--pine); outline-offset: 1px; }
.gate-err { color: var(--bad); background: var(--bad-bg); border-radius: 12px; padding: 12px 16px; font-size: 15px; }
.gate-note { color: var(--warn); background: var(--warn-bg); border-radius: 12px; padding: 12px 16px; font-size: 15px; }

/* Butoane */
.btn-main { width: 100%; min-height: 56px; border: 0; border-radius: 14px; background: var(--pine); color: #F4F7F3; font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; transition: opacity .15s, transform .15s; }
.btn-main:active { transform: scale(0.98); }
.btn-main:disabled { opacity: 0.55; }
.dark .btn-main { background: var(--d-ok); color: #0B1A13; }
.btn-sec { min-height: 48px; border: 1px solid #C2CBC3; border-radius: 12px; background: var(--surface); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; }
.dark .btn-sec { border-color: #3A5649; background: transparent; color: var(--d-ink); }
.btn-sec[aria-pressed="true"] { background: var(--ok-bg); border-color: #9CC8AE; color: var(--ok); }
.dark .btn-sec[aria-pressed="true"] { background: #1F4A37; border-color: #2E6B4E; color: #9BE7BF; }
.btn-sec[aria-expanded="true"] { border-color: var(--pine); }
.dark .btn-sec[aria-expanded="true"] { border-color: var(--d-ok); }
.link-btn { border: 0; background: none; padding: 0 4px; min-height: 48px; color: var(--blue); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.dark .link-btn { color: #9CC3F2; }
.icon-btn { width: 48px; height: 48px; border: 0; border-radius: 12px; background: transparent; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(127, 140, 133, 0.15); }

/* Căutare */
.search { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border: 1px solid #C2CBC3; border-radius: 12px; background: var(--surface); color: var(--muted); }
.search:focus-within { outline: 2px solid var(--pine); outline-offset: 1px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--ink); }
.search input::-webkit-search-cancel-button { display: none; }
.x-btn { width: 40px; height: 40px; margin-right: -8px; border: 0; border-radius: 50%; background: transparent; color: #3D4A43; display: flex; align-items: center; justify-content: center; flex: none; }

/* Panoul de detaliu: jos pe telefon, în dreapta pe ecran mare. Singurul loc cu umbră. */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(10, 18, 15, 0.5); animation: fade .2s ease-out; }
.sheet { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(10, 18, 15, 0.25); outline: none; animation: sheet-up .22s ease-out; }
.sheet.dark { background: var(--d-surface); color: var(--d-ink); color-scheme: dark; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-top { display: flex; justify-content: flex-end; margin: 0 -8px -16px 0; }
@media (min-width: 700px) {
  .sheet { top: 0; left: auto; width: 420px; max-height: none; border-radius: 0; box-shadow: -18px 0 40px rgba(10, 18, 15, 0.18); animation: sheet-in .2s ease-out; }
  .sheet-body { padding: 16px 24px 24px; flex: 1; }
}
@keyframes sheet-up { from { transform: translateY(32px); opacity: 0; } }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* Fișa invitatului */
.hero { display: flex; align-items: center; gap: 16px; padding-top: 8px; }
.hero-t { min-width: 0; }
.hero h2 { font-size: 28px; line-height: 1.05; overflow-wrap: anywhere; }
.hero .co { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.hero .co > span:not(.org) { min-width: 0; }
.dark .hero .co { color: var(--d-muted); }
.tbox { display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.tbox b { font-family: var(--display); font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
.tbox b .org { margin-left: 4px; }
.tbox > span { font-size: 15px; color: var(--muted); }
.dark .tbox { background: #F4F7F3; color: #14201B; border: 0; }
.dark .tbox > span { color: #56625A; }
.acts { display: flex; flex-direction: column; gap: 12px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.two > :only-child { grid-column: 1 / -1; }
.arrived { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); font-size: 17px; font-weight: 700; }
.dark .arrived { background: #1F4A37; color: #9BE7BF; }
.picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; }
.dark .pick { border-color: var(--d-line); background: var(--d-surface-2); color: var(--d-ink); }
.pick:disabled { opacity: 0.45; }
.pick.cur { opacity: 1; border-color: var(--blue); }
.pick .glob { --s: 22px; }
.pick .pt { display: flex; flex-direction: column; min-width: 0; }
.pick .pt b { font-size: 15px; }
.pick .pt > span { font-size: 13px; color: var(--muted); }
.dark .pick .pt > span { color: var(--d-muted); }
.pick .pt .org { margin-left: 4px; }
.note { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); font-size: 15px; }
.dark .note { background: var(--d-surface-2); }
.mates h3 { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.dark .mates h3 { color: var(--d-muted); }
.mates ul { list-style: none; margin: 0; padding: 0; }
.mates li { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: 16px; border-top: 1px solid var(--line-2); }
.dark .mates li { border-color: var(--d-line); }
.mates .n { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.mates .n > span:not(.org) { min-width: 0; }
.mates .st { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ok); font-variant-numeric: tabular-nums; }
.dark .mates .st { color: #7FE0AE; }
.mates .st.wait { font-weight: 400; color: var(--muted); }
.dark .mates .st.wait { color: var(--d-muted); }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }

/* Mesajul de jos, cu „Anulează” */
#toast { position: fixed; z-index: 90; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 24px); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; min-height: 56px; border-radius: 14px; background: #14201B; color: #F4F7F3; font-size: 15px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s; }
#toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.is-dark #toast { background: #F4F7F3; color: #14201B; }
#toast.warn, .is-dark #toast.warn { background: #7A1C24; color: #FFFFFF; }
#toast .t-msg { flex: 1; min-width: 0; padding: 4px 8px 4px 0; }
#toast .t-undo { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: #F4F7F3; color: #14201B; font-weight: 700; }
.is-dark #toast .t-undo { background: var(--pine); color: #F4F7F3; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
