/* Alpha: paleta de pe alpha.org (roșu #E42312, vișiniu #2E0704), fontul Plus Jakarta Sans,
   butoane-pastilă. Temă luminoasă/întunecată după sistem sau din butonul din antet.
   Scris întâi pentru telefon; ecranele late primesc ajustări din @media (min-width: 641px).
   Colțuri: 16px pe plăci, 12px pe elemente mici, pastilă pe butoane și chip-uri. */

/* Fontul de pe alpha.org, ținut pe site (variabil, 400-800). Latin-ext are ă, ș, ț. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/jakarta-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/jakarta-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;
}

:root {
  color-scheme: light dark;
  --red: #e42312;
  --red-deep: #cc0000;
  --maroon: #2e0704;
  --bg: #fff8f7;
  --surface: #ffffff;
  --surface-2: #fcefed;
  --line: #f3dfdc;
  --line-strong: #e6c3be;
  --text: #2e0704;
  --muted: #7a4f49;
  --accent: var(--red);
  --accent-hover: var(--red-deep);
  --accent-soft: #fde6e3;
  --on-soft: #a8160a;
  --accent-ink: #ffffff;
  --top-bg: var(--red);
  --ok: #1f7a4a;
  --ok-soft: #e2f4ea;
  --shadow: 0 1px 2px rgb(46 7 4 / 0.06), 0 14px 34px -18px rgb(46 7 4 / 0.28);
  --r: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Înălțimea barei de sus și a celei de jos (telefon), ca elementele lipite să nu intre sub ele. */
  --topbar-h: calc(58px + env(safe-area-inset-top));
  --tabbar-h: calc(68px + env(safe-area-inset-bottom));
}

/* Tema închisă: după sistem, sau forțată din butonul din antet (data-theme pe <html>).
   Tokenii sunt scriși de două ori (aici și în [data-theme='dark']): schimbă-i în ambele locuri. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #150403;
    --surface: #220806;
    --surface-2: #2e0b08;
    --line: #431410;
    --line-strong: #63221b;
    --text: #fff3f1;
    --muted: #d8b1ab;
    --accent-hover: #f23a28;
    --accent-soft: #3d0f0b;
    --on-soft: #ff9184;
    --top-bg: var(--maroon);
    --ok: #6fd69c;
    --ok-soft: #10301f;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 36px -18px rgb(0 0 0 / 0.8);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #150403;
  --surface: #220806;
  --surface-2: #2e0b08;
  --line: #431410;
  --line-strong: #63221b;
  --text: #fff3f1;
  --muted: #d8b1ab;
  --accent-hover: #f23a28;
  --accent-soft: #3d0f0b;
  --on-soft: #ff9184;
  --top-bg: var(--maroon);
  --ok: #6fd69c;
  --ok-soft: #10301f;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 36px -18px rgb(0 0 0 / 0.8);
}
:root[data-theme='light'] { color-scheme: light; }

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  /* Loc pentru bara de jos de pe telefon. */
  padding-bottom: calc(var(--tabbar-h) + 20px);
}
body[data-page='login'] { padding-bottom: env(safe-area-inset-bottom); }

h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }

/* Meniul diferă pentru admin: data-role e pus din <head> (din ultima vizită), apoi confirmat de server. */
html:not([data-role='admin']) [data-for='admin'],
html[data-role='admin'] [data-for='user'] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
html { accent-color: var(--accent); caret-color: var(--accent); scrollbar-color: var(--line-strong) transparent; }
.hero ::selection, .verse ::selection { background: #fff; color: var(--red); }

/* ---------- Bara de sus: roșie (vișinie pe tema închisă), ca pe alpha.org ---------- */
.topbar-band {
  position: sticky;
  top: 0;
  z-index: 6;
  /* Fundal plin, fără backdrop-filter: filtrul ar face din antet „containerul” barei fixe de jos
     (.tabbar e în antet), iar bara ar apărea sus, peste el. */
  background: var(--top-bg);
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.topbar { display: flex; align-items: center; gap: 8px; height: 58px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: #fff;
}
.brand-mark { display: block; flex: none; width: 34px; height: auto; }
.brand-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 300px;
  background: rgb(255 255 255 / 0.18);
}
.top-actions { display: flex; gap: 6px; margin-left: auto; }
.round-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 300px;
  border: 0;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s var(--ease);
}
.round-btn:hover { background: rgb(255 255 255 / 0.26); }
.round-btn:active { transform: scale(0.94); }
.topbar-band :focus-visible { outline-color: #fff; }

/* ---------- Navigarea: bară fixă jos pe telefon, pastile în antet pe ecran lat ---------- */
.tabbar {
  position: fixed;
  z-index: 7;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  /* Fundal plin, fără blur: blur-ul peste conținutul care se derulează e scump pe telefoanele mai slabe. */
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.tabbar a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-height: 56px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}
.tabbar i {
  display: grid;
  place-items: center;
  width: 58px;
  height: 30px;
  border-radius: 300px;
  font-size: 22px;
  transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.tabbar a:active i { transform: scale(0.92); }
.tabbar a[aria-current='page'] { color: var(--text); }
.tabbar a[aria-current='page'] i { background: var(--accent); color: var(--accent-ink); }

/* ---------- Câmpuri și butoane ---------- */
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label { font-weight: 700; font-size: 15px; }

/* 17px: sub 16px, iPhone-ul mărește pagina când atingi câmpul. */
.input, .field input:not([type='checkbox']), .select, .textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-size: 17px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: border-color 0.2s;
}
.textarea { height: auto; min-height: 150px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.input:focus, .field input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field input[aria-invalid='true'] { border-color: var(--accent); }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.help { font-size: 14px; color: var(--muted); }
.help strong { color: var(--text); font-weight: 700; }
.error { font-size: 14px; font-weight: 600; color: var(--on-soft); }
.fields-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

.pass { position: relative; }
.pass input { padding-right: 52px; }
.pass-eye {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 300px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn i { font-size: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.is-busy { opacity: 0.7; cursor: progress; }
/* Butonul secundar de pe alpha.org: contur roșu, fără fundal. */
.btn-ghost { background: transparent; border-color: var(--accent); color: var(--on-soft); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-quiet { background: var(--surface-2); color: var(--text); }
.btn-quiet:hover { background: var(--accent-soft); }
.btn-block { width: 100%; height: 54px; font-size: 16px; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-sm i { font-size: 16px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 300px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.icon-btn i { font-size: 18px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.is-confirm { background: var(--accent); color: var(--accent-ink); padding: 0 12px; }
.icon-danger { color: var(--on-soft); }
/* Butonul [i]: explicația rolului. */
.info-btn { color: var(--on-soft); }
.info-btn i { font-size: 21px; }

.text-btn {
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--on-soft);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 9px;
  border-radius: 300px;
  background: var(--accent-soft);
  color: var(--on-soft);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.count.is-full { background: var(--ok-soft); color: var(--ok); }

/* ---------- Login ---------- */
.auth { display: grid; gap: 26px; max-width: 480px; padding-top: 22px; padding-bottom: 40px; }
.auth-intro h1 { font-size: clamp(40px, 12vw, 60px); letter-spacing: -0.045em; line-height: 0.98; }
.hl { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .hl { color: var(--on-soft); } }
:root[data-theme='dark'] .hl { color: var(--on-soft); }
.auth-intro p { margin-top: 14px; color: var(--muted); font-size: 17px; max-width: 34ch; }
.auth-card {
  display: grid;
  gap: 22px;
  padding: 20px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.auth-title { font-size: 24px; }
.auth-form { display: grid; gap: 18px; }
.auth-switch { text-align: center; font-size: 15px; color: var(--muted); }
.auth-help { text-align: center; }

/* ---------- Capul paginilor ---------- */
.page { padding-top: 6px; }
.page-head { display: grid; gap: 8px; padding: 18px 0 18px; }
.page-head h1 { font-size: clamp(32px, 9vw, 48px); letter-spacing: -0.04em; }
.page-head p { color: var(--muted); }

.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 21px; }
.section-head p { color: var(--muted); font-size: 14px; }
.section-sub { margin: -6px 0 12px; color: var(--muted); font-size: 14px; }

/* ---------- Alegerea serii (Înscriere, Curățenie) ---------- */
.picker {
  position: sticky;
  top: var(--topbar-h);
  z-index: 4;
  display: flex;
  gap: 8px;
  margin: 0 -16px;
  padding: 10px 16px 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  background: var(--bg);
}
.picker::-webkit-scrollbar { display: none; }
.pick {
  flex: none;
  display: grid;
  justify-items: center;
  min-width: 64px;
  padding: 7px 10px 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}
.pick:active { transform: scale(0.96); }
.pick strong { font-size: 22px; line-height: 1.1; color: var(--text); letter-spacing: -0.03em; }
.pick.is-past { opacity: 0.55; }
.pick[aria-current='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); opacity: 1; }
.pick[aria-current='true'] strong { color: var(--accent-ink); }
.pick-dot { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: var(--accent); }
.pick[aria-current='true'] .pick-dot { background: var(--accent-ink); }
.pick-dot.is-empty { visibility: hidden; }

.meeting-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 2px 0 6px; color: var(--muted); font-size: 15px; }
.meeting-line strong { color: var(--text); font-size: 17px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 300px;
  background: var(--accent-soft);
  color: var(--on-soft);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Acasă ---------- */

/* Seara următoare: placa roșie, ca blocurile de pe alpha.org. */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 4px;
  padding: 20px 20px 22px;
  border-radius: 22px;
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow);
}
/* Semnul Alpha (icons/mark-white.png), mare și abia vizibil în colț. */
.hero::after {
  content: '';
  position: absolute;
  right: -36px;
  bottom: -52px;
  width: 190px;
  height: 172px;
  background: url('/icons/mark-white.png') center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}
.hero > * { position: relative; }
/* Salutul stă în placa roșie (Acasă aerisită, 20 oct 2026): un singur titlu mare pe ecran, data. */
.hero-hi { margin: 0 0 4px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; opacity: 0.92; }
.hero-date { font-size: clamp(30px, 9vw, 44px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-weight: 600; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-title {
  justify-self: start;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 300px;
  background: rgb(255 255 255 / 0.18);
  font-size: 14px;
  font-weight: 700;
}

.empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 20px;
  border-radius: var(--r);
  border: 1.5px dashed var(--line-strong);
  color: var(--muted);
}
.empty > i { font-size: 30px; color: var(--accent); }
.empty strong { color: var(--text); font-size: 17px; }

.entry-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--on-soft);
  font-size: 22px;
}
.entry-text { display: grid; min-width: 0; }
.entry-text strong { font-weight: 700; font-size: 16px; line-height: 1.25; }
.entry-text span, .entry-text a { font-size: 13px; color: var(--muted); }
.entry-text a { color: var(--on-soft); font-weight: 700; }

/* Acasă: titluri de secțiune mai liniștite și mult aer între secțiuni. */
body[data-page='acasa'] .page { padding-top: 18px; }
body[data-page='acasa'] .section { margin-top: 36px; }
.home-title { margin-bottom: 12px; font-size: 19px; }

/* Rolurile tale: un singur grup de rânduri, fără butoane pe rând. Atingerea deschide foaia [i]. */
.rows { list-style: none; margin: 0; padding: 0; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 0 14px 0 16px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s;
}
.row:active { background: var(--surface-2); }
.row > .ph:first-child { font-size: 22px; color: var(--on-soft); }
.row-title { min-width: 0; overflow-wrap: anywhere; }
.row-go { font-size: 16px; color: var(--muted); }
.add-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 10px 4px;
  color: var(--on-soft);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.add-link .ph { font-size: 17px; }

/* Prezența: două pastile pe un rând, roșii când ești trecut. */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 300px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.15s var(--ease);
}
.pill .ph { font-size: 19px; color: var(--on-soft); }
.pill:active { transform: scale(0.96); }
.pill[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill[aria-pressed='true'] .ph { color: var(--accent-ink); }
.pill:disabled { cursor: progress; }

/* Partener / Facilitator: comutatoare, fără limită de locuri. */
.presence { display: grid; gap: 8px; }
.toggle-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px 12px 12px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.toggle-row.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
.toggle-row .entry-icon { transition: background-color 0.2s, color 0.2s; }
.toggle-row.is-on .entry-icon { background: var(--accent); color: var(--accent-ink); }
.who { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Comutatorul: pastilă cu un cerc care alunecă; roșu când e pornit. */
.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 300px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.25s var(--ease);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 0.3s var(--ease);
}
.switch[aria-checked='true'] { background: var(--accent); }
.switch[aria-checked='true']::after { transform: translateX(20px); }
.switch:disabled { opacity: 0.5; cursor: progress; }

.later { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.later li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.date-chip {
  display: grid;
  justify-items: center;
  padding: 6px 0;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.15;
}
.date-chip strong { font-size: 21px; color: var(--text); letter-spacing: -0.03em; }
.later-roles { font-size: 14px; font-weight: 600; }

/* ---------- Înscriere: registrul de roluri ---------- */
.roles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.role {
  padding: 12px 12px 12px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.role.is-full { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.role-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; }
.role-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.slots { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 0 6px 0 8px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
}
.slot.is-me { background: var(--accent); color: var(--accent-ink); }
.slot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--on-soft);
  font-size: 13px;
  font-weight: 800;
}
.slot.is-me .avatar { background: rgb(255 255 255 / 0.22); color: #fff; }
.slot .icon-btn { min-width: 34px; height: 34px; color: inherit; opacity: 0.8; }
.slot.is-me .icon-btn:hover { background: rgb(255 255 255 / 0.18); }
.slot-free {
  justify-content: center;
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  color: var(--on-soft);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}
.slot-free:hover { border-color: var(--accent); background: var(--accent-soft); }
.slot-free:active { transform: scale(0.97); }
.slot-free:disabled { color: var(--muted); cursor: default; }
.slot.is-new { animation: pop-in 0.45s var(--ease); }

/* Curățenia și prezența: fără limită, deci chip-uri cu nume în loc de locuri. */
.open-role { padding: 14px; border-radius: var(--r); background: var(--surface); border: 1.5px solid var(--line); }
.open-role .role-head { margin-bottom: 12px; }
.chips { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 300px;
  background: var(--accent-soft);
  color: var(--on-soft);
  font-size: 14px;
  font-weight: 600;
  animation: pop-in 0.4s var(--ease) both;
}
.chip.is-me { background: var(--accent); color: var(--accent-ink); }
.chip-x {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px -8px -4px -2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chip-x:hover { background: color-mix(in srgb, currentColor 18%, transparent); }
.chips-none { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.open-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Curățenie: checklist-ul live ---------- */
.progress {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.progress-num { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.progress-num small { font-size: 18px; color: var(--muted); }
.progress-live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.progress-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
.bar { height: 10px; border-radius: 300px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform 0.5s var(--ease); }
.progress.is-done .bar span { background: var(--ok); }
.progress .chips { margin: 0; }
.progress-leave { justify-self: start; }

.zone { margin-top: 26px; }
.zone-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 10px; }
.zone-head h2 { font-size: 20px; }
.zone-head p { font-size: 13px; color: var(--muted); }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 13px 14px 13px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s var(--ease);
}
.task:active { transform: scale(0.985); }
.task:disabled { cursor: default; transform: none; }
.task-box {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -2px;
  border-radius: 9px;
  border: 2px solid var(--line-strong);
  color: transparent;
  font-size: 17px;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.task-text { display: grid; gap: 2px; font-size: 15px; line-height: 1.4; }
.task-by { font-size: 12px; font-weight: 600; color: var(--muted); }
.task[aria-checked='true'] { border-color: transparent; background: var(--ok-soft); }
.task[aria-checked='true'] .task-box { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop-in 0.35s var(--ease); }
.task[aria-checked='true'] .task-text > span:first-child { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 40%, transparent); color: var(--muted); }

/* Pop-up-ul cu versetul, când toată lista e bifată. */
.verse {
  width: min(420px, calc(100vw - 32px));
  margin: auto;
  padding: 30px 24px 24px;
  border: 0;
  border-radius: 24px;
  background: var(--red);
  color: #fff;
  text-align: center;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.5);
}
.verse::backdrop { background: rgb(46 7 4 / 0.6); }
.verse[open] { animation: verse-in 0.6s var(--ease); }
.verse-mark { font-size: 54px; line-height: 1; }
.verse h2 { margin-top: 10px; font-size: 22px; }
.verse blockquote { margin: 16px 0 6px; font-size: 21px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.verse cite { display: block; font-style: normal; font-weight: 600; opacity: 0.9; }
.verse .btn { margin-top: 22px; width: 100%; background: #fff; color: var(--red); }
.verse .btn:hover { background: #fff3f1; }

/* ---------- Echipa (admin) ---------- */
.card { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.add-form { display: grid; gap: 14px; }
.add-form .btn { justify-self: stretch; }

.meetings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.meeting { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.meeting.is-next { border-color: var(--accent); border-width: 1.5px; }
.meeting.is-past { opacity: 0.7; }
.meeting summary {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  cursor: pointer;
  list-style: none;
}
.meeting summary::-webkit-details-marker { display: none; }
.meeting-sum { display: grid; gap: 2px; min-width: 0; }
.meeting-sum strong { font-size: 16px; }
.meeting-sum span { font-size: 13px; color: var(--muted); }
.meeting-body { display: grid; gap: 14px; padding: 4px 14px 16px; border-top: 1px solid var(--line); }
.meeting-body h4 { margin: 10px 0 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.meeting-body .chips { margin: 0; }
.gap-list { display: flex; flex-wrap: wrap; gap: 6px; }
.gap-list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 300px;
  border: 1.5px dashed var(--accent);
  color: var(--on-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.gap-list a:hover { background: var(--accent-soft); }
.meeting-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.meeting-actions .icon-danger { margin-left: auto; }

.search { position: relative; margin-bottom: 12px; }
.search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.search input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  font-size: 17px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 300px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.person .avatar { width: 40px; height: 40px; font-size: 15px; }
.person-id { display: grid; min-width: 0; }
.person-id strong { overflow-wrap: anywhere; }
.person-id span { font-size: 13px; color: var(--muted); }
.person-actions { display: flex; }

/* ---------- Ferestrele de jos (Setări, [i], parolă, cine se înscrie) ---------- */
.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 88dvh;
  margin: auto 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow-y: auto;
}
.sheet::backdrop { background: rgb(46 7 4 / 0.5); }
.sheet[open] { animation: sheet-up 0.35s var(--ease); }
.sheet form { display: grid; gap: 14px; }
.sheet h2 { font-size: 22px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 4px; }
.sheet-actions .btn { flex: 1; }

/* Explicația unui rol (butonul [i]). */
.role-info { display: grid; gap: 14px; }
.role-info-head { display: flex; align-items: center; gap: 12px; }
.role-info-head h2 { flex: 1; font-size: 20px; line-height: 1.2; }
.role-info-text { padding: 14px 16px; border-radius: var(--r-sm); background: var(--surface-2); line-height: 1.55; white-space: pre-line; }
.role-info-text.is-empty { color: var(--muted); }

/* Setările (rotița din antet). */
.settings-body { display: grid; }
.set-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--on-soft);
  font-size: 22px;
}
.set-text { display: grid; gap: 2px; }
.set-text strong { font-weight: 700; }
.set-text > span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.set-link { justify-self: start; margin: 2px 0 -6px; padding-left: 0; font-size: 14px; }
.set-steps { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.set-steps b { color: var(--text); font-weight: 700; }
.set-steps i { vertical-align: -2px; color: var(--on-soft); }
.set-logout { margin-top: 10px; }
/* Codul QR spre APK (Setări pe calculator): alb chiar și pe tema închisă, altfel camera nu-l citește. */
.set-qr { width: 104px; height: 104px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.ask { display: grid; justify-items: start; gap: 10px; }
.ask p { color: var(--muted); margin-bottom: 6px; }
.ask .sheet-actions { width: 100%; }

/* ---------- Stări ---------- */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--on-soft);
  font-weight: 600;
}

.skeleton {
  display: block;
  border-radius: var(--r);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel-hero { height: 170px; border-radius: 22px; }
.skel-row { height: 64px; margin-top: 8px; }
.skel-role { height: 124px; }

.toast {
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  z-index: 10;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  border-radius: var(--r);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -16px);
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
/* Mesajul e popover (vezi toast() din common.js): anulează poziționarea implicită a browserului. */
.toast[popover] { right: auto; bottom: auto; height: auto; margin: 0; border: 0; overflow: visible; }

/* ---------- Mișcare ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.88); } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes verse-in { from { transform: translateY(24px) scale(0.94); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 50% { opacity: 0.35; } }

/* Intrarea animată e doar pe login. Între paginile aplicației, nicio tranziție: filele sunt prerandate și
   se desenează din cache, deci schimbarea e instantanee; o estompare ar părea mai lentă. */
@media (prefers-reduced-motion: no-preference) {
  body[data-page='login'] .auth-intro { animation: rise 0.6s var(--ease) both; }
  body[data-page='login'] .auth-card { animation: rise 0.6s var(--ease) 0.08s both; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 360px) {
  .slots { grid-template-columns: minmax(0, 1fr); }
  .fields-row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Ecran lat ---------- */
@media (min-width: 641px) {
  :root { --topbar-h: 66px; }
  body { padding-bottom: 60px; }
  .wrap { padding: 0 24px; }
  .topbar { height: 66px; gap: 16px; }
  .tabbar {
    position: static;
    display: flex;
    gap: 4px;
    margin-left: auto;
    padding: 0;
    background: none;
    border: 0;
    color: rgb(255 255 255 / 0.85);
  }
  .tabbar a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 0;
    padding: 9px 15px;
    border-radius: 300px;
    font-size: 15px;
    transition: color 0.2s, background-color 0.2s;
  }
  .tabbar a:hover { color: #fff; background: rgb(255 255 255 / 0.14); }
  .tabbar i { width: auto; height: auto; font-size: 18px; background: none !important; color: inherit !important; }
  .tabbar a[aria-current='page'] { color: var(--top-bg); background: #fff; }
  .top-actions { margin-left: 0; }

  .auth { margin-top: 5vh; padding-top: 0; }
  .auth-card { padding: 28px; }
  .page-head { padding: 30px 0 22px; }
  .hero { padding: 28px 30px 30px; }
  .picker { margin: 0; padding: 12px 0; }
  .roles { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .add-form { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
  .add-form .field-wide { grid-column: span 2; }
  .add-form .btn { grid-column: span 2; }

  .sheet { width: min(460px, calc(100vw - 32px)); margin: auto; padding: 24px; border-radius: 20px; }
  .sheet-actions { justify-content: flex-end; }
  .sheet-actions .btn { flex: none; }
}
