/* =====================================================================
   VEHICUL — sistemul de design comun (culori, text, butoane, câmpuri, foi)
   Fiecare parte are fișierul ei: login.css, student.css, admin.css
   ===================================================================== */
:root {
  /* brand (dungile din logo) */
  --red: #D7262E; --yellow: #F5B700; --green: #2FA24A; --blue: #1F6FD1;
  /* asfalt (logare) */
  --asphalt: #16191D; --asphalt-2: #22262C; --asphalt-3: #30353D;
  /* hârtie și cerneală */
  --bg: #F3F1EC; --paper: #FBFAF7; --card: #FFFFFF;
  --ink: #1F2328; --ink-2: #4A5058; --ink-3: #6B7178; --line: #DAD6CC; --line-2: #ECE9E2;
  --rule: #2B2B2B;          /* liniile tabelului, ca pe foaie */
  --sheet-head: #DCDCDC;    /* celula gri cu ziua */
  --pen: #1A3A8A;           /* „pixul albastru” — numele meu */
  --action: #1F5FC9; --action-ink: #FFFFFF; --action-soft: #E6EEFB;
  /* stările sloturilor (text / fundal / chenar) — fiecare are și cuvânt + iconiță */
  --free: #14662B; --free-bg: #E7F5EA; --free-line: #2FA24A;
  --pend: #6B4A00; --pend-bg: #FFF4D1; --pend-line: #B98500;
  --conf: #1A3A8A; --conf-bg: #E6F0FC; --conf-line: #1F6FD1;
  --taken: #4A5058; --taken-bg: #EFEDE8;
  --closed: #6B7178;
  --danger: #B3001B; --danger-bg: #FDECEE;
  --ok: #14662B; --ok-bg: #E7F5EA;

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', cursive;

  --r-sm: 8px; --r: 14px; --r-lg: 22px; --r-sheet: 26px;
  --shadow-1: 0 1px 2px rgba(20, 22, 26, .06), 0 2px 8px rgba(20, 22, 26, .05);
  --shadow-2: 0 10px 30px rgba(20, 22, 26, .12), 0 2px 6px rgba(20, 22, 26, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.45; color: var(--ink);
  background: var(--bg); -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums;
  min-height: 100vh; min-height: 100dvh;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--action); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; display: block; }
[hidden] { display: none !important; }

/* ------------------------------------------------ brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-words { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 800; letter-spacing: .04em; color: var(--ink); font-size: 18px; }
.brand-sub { font-weight: 700; letter-spacing: .16em; color: var(--red); font-size: 9.5px; margin-top: 4px; }
.brand-sm .brand-name { font-size: 15px; } .brand-sm .brand-sub { font-size: 8px; }
.brand-lg .brand-name { font-size: 40px; } .brand-lg .brand-sub { font-size: 14px; margin-top: 8px; }
.logo-car.animated .draw { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.4s var(--ease) var(--d) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------ butoane */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: var(--r); border: 1.5px solid transparent;
  font-weight: 650; font-size: 17px; text-decoration: none; user-select: none;
  transition: transform .12s var(--ease), background-color .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent;
  animation: spin .7s linear infinite;
}
.btn-ghost.is-busy::after, .btn-soft.is-busy::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary { background: var(--action); color: var(--action-ink); box-shadow: 0 6px 16px rgba(31, 95, 201, .25); }
.btn-dark { background: var(--asphalt); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-soft { background: var(--action-soft); color: var(--action); }
.btn-ok { background: var(--green); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #F1C3CA; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-row > .btn { flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: transparent; color: var(--ink-2); position: relative;
}
.icon-btn:hover { background: rgba(0,0,0,.05); }
.badge-dot {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ------------------------------------------------ câmpuri */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-weight: 650; font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.field-hint { display: block; font-size: 14px; color: var(--ink-3); margin-top: 6px; }
.field-error { display: flex; gap: 6px; font-size: 14.5px; color: var(--danger); margin-top: 6px; font-weight: 550; }
.input, .select, .textarea {
  width: 100%; min-height: 54px; padding: 0 16px; border-radius: var(--r); border: 1.5px solid var(--line);
  background: var(--card); font-size: 18px; transition: border-color .15s, box-shadow .15s; appearance: none;
}
.textarea { padding: 12px 16px; min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 111, 209, .16); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(179, 0, 27, .1); }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234A5058' stroke-width='2'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 44px; }
.input-wrap { position: relative; }
.input-wrap .icon-btn { position: absolute; right: 5px; top: 5px; }

.switch { position: relative; display: inline-block; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #C9C6BE; border-radius: 16px; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 26px; height: 26px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.switch input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ------------------------------------------------ RU/RO */
.lang-switch { display: inline-flex; background: rgba(0,0,0,.06); border-radius: 999px; padding: 3px; }
.lang-switch button { border: 0; background: transparent; min-width: 44px; height: 44px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.lang-switch button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.lang-switch.dark { background: rgba(255,255,255,.1); }
.lang-switch.dark button { color: rgba(255,255,255,.7); }
.lang-switch.dark button.on { background: #fff; color: var(--asphalt); }

/* ------------------------------------------------ carduri */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 18px; }
.muted { color: var(--ink-3); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--action-soft); color: var(--ink); }
.notice .ic { color: var(--action); margin-top: 2px; }
.notice-warn { background: var(--pend-bg); } .notice-warn .ic { color: var(--pend); }
.notice-danger { background: var(--danger-bg); } .notice-danger .ic { color: var(--danger); }

/* ------------------------------------------------ bottom sheet / dialog */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(16, 18, 22, .45); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 8px 20px calc(22px + var(--safe-b));
  transform: translateY(100%); transition: transform .32s var(--ease); outline: none;
}
.sheet-wide { max-width: 760px; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: #D5D1C8; margin: 4px auto 10px; }
.sheet-head .icon-btn { flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sheet-title { font-size: 21px; font-weight: 750; }
.sheet-text { font-size: 17px; color: var(--ink-2); margin: 4px 0 0; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--r-lg); transform: translateY(16px) scale(.98); opacity: 0; transition: transform .25s var(--ease), opacity .2s; padding-bottom: 22px; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet-grip { display: none; }
}

/* ------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); z-index: 200; transform: translate(-50%, 30px); opacity: 0;
  display: flex; gap: 10px; align-items: flex-start; max-width: min(92vw, 460px); padding: 14px 16px; border-radius: 16px;
  background: var(--asphalt); color: #fff; font-size: 16px; font-weight: 550; box-shadow: var(--shadow-2);
  transition: transform .3s var(--ease), opacity .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-success .ic { color: #7FE09A; } .toast-error { background: #5E0B17; } .toast-error .ic { color: #FFB3BE; }

/* ------------------------------------------------ încărcare */
.loader { display: grid; place-items: center; min-height: 60vh; color: var(--ink-3); gap: 14px; }
.loader .logo-car { opacity: .9; }
.skeleton { background: linear-gradient(90deg, #ECE9E2 25%, #F5F3EE 50%, #ECE9E2 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.offline-bar { position: sticky; top: 0; z-index: 90; background: var(--pend-bg); color: var(--pend); text-align: center; font-size: 14.5px; font-weight: 600; padding: 8px 12px; }

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