/* Companion — stiluri proprii aplicației, peste design system (theme.css) */

html, body { height: 100%; }
body { overscroll-behavior-y: none; }

/* ---------- Ecran de pornire ---------- */

.pornire {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  background: var(--bg);
  transition: opacity 320ms ease, visibility 320ms;
}
.pornire.e-gata { opacity: 0; visibility: hidden; }
.pornire__i {
  width: 96px; height: 96px; border-radius: 22%; display: grid; place-items: center;
  background: linear-gradient(160deg, #e8232e 0%, #c8161f 55%, #9d0f16 100%);
  box-shadow: 0 2px 6px rgba(28,28,30,0.1), 0 10px 26px rgba(28,28,30,0.14);
  animation: urca 520ms cubic-bezier(.22,1,.36,1) both;
}
.pornire__t { text-align: center; animation: urca 520ms 60ms cubic-bezier(.22,1,.36,1) both; }
.pornire__n { margin: 0; font-family: var(--sans); font-size: 24px; font-weight: 700; letter-spacing: -0.026em; }
.pornire__s { margin: 5px 0 0; font-size: 13px; color: var(--faint); }
.pornire__m { position: absolute; bottom: calc(26px + var(--sab)); margin: 0; font-size: 11px; color: var(--faint); }

@keyframes urca { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Tranziții între ecrane ---------- */

#app { opacity: 1; }
.v-intra > .body > * { animation: intra 300ms cubic-bezier(.22,1,.36,1) both; }
.v-intra > .body > *:nth-child(2) { animation-delay: 30ms; }
.v-intra > .body > *:nth-child(3) { animation-delay: 60ms; }
.v-intra > .body > *:nth-child(4) { animation-delay: 90ms; }
.v-intra > .body > *:nth-child(n+5) { animation-delay: 110ms; }
@keyframes intra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.v-intra .hdr { animation: antet 260ms cubic-bezier(.22,1,.36,1) both; }
@keyframes antet { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

::view-transition-old(root) { animation: iese 160ms ease both; }
::view-transition-new(root) { animation: vine 220ms cubic-bezier(.22,1,.36,1) both; }
@keyframes iese { to { opacity: 0; } }
@keyframes vine { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Rânduri care apar pe măsură ce vin datele ---------- */

.rows .row { animation: rand 260ms cubic-bezier(.22,1,.36,1) both; }
.rows .row:nth-child(1) { animation-delay: 0ms; }
.rows .row:nth-child(2) { animation-delay: 28ms; }
.rows .row:nth-child(3) { animation-delay: 56ms; }
.rows .row:nth-child(4) { animation-delay: 84ms; }
.rows .row:nth-child(n+5) { animation-delay: 100ms; }
@keyframes rand { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Toasturi ---------- */

.toasts {
  position: fixed; left: 0; right: 0; bottom: calc(86px + var(--sab)); z-index: 70;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 0 16px; pointer-events: none;
}
.toasts .toast { pointer-events: auto; max-width: 100%; animation: toastin 300ms cubic-bezier(.22,1,.36,1) both; }
.toasts .toast.pleaca { animation: toastout 220ms ease forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- Straturi: foi, alerte, meniuri ---------- */

#straturi { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
#straturi:empty { display: none; }
#straturi > * { pointer-events: auto; }
#straturi .ovl { position: fixed; animation: valin 240ms ease both; }
#straturi .ovl.pleaca { animation: valout 200ms ease forwards; }
@keyframes valin { from { opacity: 0; } to { opacity: 1; } }
@keyframes valout { to { opacity: 0; } }

#straturi .sheet { position: fixed; animation: foaiein 340ms cubic-bezier(.22,1,.36,1) both; }
#straturi .sheet.pleaca { animation: foaieout 240ms cubic-bezier(.3,0,.8,.15) forwards; }
@keyframes foaiein { from { transform: translateY(100%); } to { transform: none; } }
@keyframes foaieout { to { transform: translateY(100%); } }

#straturi .alert { position: fixed; animation: alertain 280ms cubic-bezier(.22,1,.36,1) both; }
#straturi .alert.pleaca { animation: alertaout 180ms ease forwards; }
@keyframes alertain { from { opacity: 0; transform: translateY(-50%) scale(.92); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
@keyframes alertaout { to { opacity: 0; transform: translateY(-50%) scale(.96); } }

/* ---------- Tastatura ---------- */

/* Pe iOS fără interactive-widget, --kb ține barele deasupra tastaturii. */
.tabs { transform: translateY(calc(-1 * var(--kb, 0px))); transition: transform 180ms ease; }
.actions { transform: translateY(calc(-1 * var(--kb, 0px))); transition: transform 180ms ease; }
body.tastatura .tabs { opacity: 0; pointer-events: none; transform: translateY(100%); }
body.tastatura .toasts { bottom: calc(16px + var(--kb, 0px)); }

/* ---------- Bară de stare a conexiunii ---------- */

.offline {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(8px + var(--sat)); z-index: 75;
  display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: var(--pill);
  background: #1c1c1e; color: #fff; font-family: var(--sans); font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(28,28,30,0.3);
  animation: toastin 300ms cubic-bezier(.22,1,.36,1) both;
}
.offline__d { width: 7px; height: 7px; border-radius: 50%; background: #ff8a92; }

/* ---------- Trageri și stări ---------- */

.reincarca { display: flex; justify-content: center; padding: 10px 0; }
.eroare { text-align: center; padding: 30px 22px; }
.eroare__t { margin: 0 0 7px; font-family: var(--sans); font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.eroare__s { margin: 0 0 18px; font-size: 14px; line-height: 20px; color: var(--muted); }

.chev { display: inline-flex; color: #c4c4cc; }
.chev svg { width: 18px; height: 18px; }

.ln { display: flex; gap: 12px; }
.ln__w { flex: none; width: 48px; font-size: 12px; line-height: 20px; font-weight: 600; color: var(--faint); }
.ln__t { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 20px; }

.cols { display: flex; align-items: flex-end; gap: 7px; height: 110px; }
.col { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; }
.col__b { border-radius: 7px 7px 3px 3px; background: var(--red-soft-2); min-height: 4px; }
.col__b.is-top { background: var(--red); }
.col__l { text-align: center; font-size: 10px; font-weight: 600; color: var(--faint); }

.dept { display: flex; align-items: center; gap: 11px; padding: 9px 0; }
.dept + .dept { box-shadow: inset 0 1px 0 var(--hair); }
.dept__n { flex: 1 1 auto; min-width: 0; font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.dept__t { flex: none; width: 86px; height: 7px; border-radius: var(--pill); background: var(--track); overflow: hidden; }
.dept__f { height: 100%; border-radius: var(--pill); background: var(--red); transition: width 420ms cubic-bezier(.22,1,.36,1); }
.dept__v { flex: none; width: 30px; text-align: right; font-family: var(--sans); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Autentificare ---------- */

.login { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 24px 20px; }
.login__i {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 22%; display: grid; place-items: center;
  background: linear-gradient(160deg, #e8232e 0%, #c8161f 55%, #9d0f16 100%);
  box-shadow: 0 2px 6px rgba(28,28,30,0.1), 0 10px 26px rgba(28,28,30,0.14);
}
.login__t { margin: 0; text-align: center; font-family: var(--sans); font-size: 26px; font-weight: 700; letter-spacing: -0.028em; }
.login__s { margin: 6px 0 0; text-align: center; font-size: 14px; line-height: 20px; color: var(--muted); }
.login__e { margin: 0; font-size: 13px; line-height: 18px; color: var(--red); text-align: center; }

/* ---------- Mărunțișuri ---------- */

.btn.e-ocupat { pointer-events: none; opacity: .7; }
.btn.e-ocupat .spin { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
