/* Vandok — shared components, built strictly on design/tokens.css.
   Colour never carries meaning alone: status uses colour + shape + word.
   Driver contrast ≥7:1; touch targets ≥56px; nothing below 15px in app content. */

/* Self-hosted (VD-R001: no CDN). Variable woff2, split latin / latin-ext so Romanian ă ș ț (in the
   ext range; â î are already in latin) render from the same family instead of falling back. */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/SpaceGrotesk-latin.woff2') format('woff2');
  font-weight: 400 700; font-display: swap;
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/SpaceGrotesk-latinext.woff2') format('woff2');
  font-weight: 400 700; font-display: swap;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-latin.woff2') format('woff2');
  font-weight: 400 800; font-display: swap;
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-latinext.woff2') format('woff2');
  font-weight: 400 800; font-display: swap;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--vd-font);
  background: var(--vd-field);
  color: var(--vd-ink);
  font-size: var(--vd-fs-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.vd-num { font-variant-numeric: tabular-nums; }
button { font-family: inherit; }

/* ---- the identity thread: 3px orange under the status bar ---- */
.vd-identity-thread { height: 3px; background: var(--vd-identity); flex: none; }

/* ---- cards ---- */
/* Glassmorphism (all surfaces): translucent card + backdrop blur over the app's gradient-mesh
   atmosphere. Alpha kept high enough that a number stays legible while scrolling. */
.vd-card {
  background: var(--vd-glass-card);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid var(--vd-glass-edge);
  box-shadow: var(--vd-glass-shadow), inset 0 1px 0 var(--vd-glass-hi);
  border-radius: 16px;
  padding: var(--vd-space-4);
}
/* status accents: colour + a shape (the border) + a word live in the content */
.vd-card--ok   { border-left: 3px solid var(--vd-ok); }
.vd-card--warn { border-top: 2px solid var(--vd-attention); }
.vd-card--fail { border-top: 2px solid var(--vd-fail); }
/* high-emphasis slab stays solid so the big figure/name pops */
.vd-card--next { background: var(--vd-invert-bg); color: var(--vd-invert-ink); border-color: var(--vd-invert-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.vd-card--next .vd-muted { color: var(--vd-invert-soft); }
/* Forced light "paper" surface (fișă cards, sheets that stay white in BOTH themes) — pin the text to
   dark values so it never becomes light-on-light in the night theme. */
.vd-paper { color: #101826; }
.vd-paper .vd-muted, .vd-paper label, .vd-paper .vd-section-label { color: #48566a; }
.vd-paper .vd-input, .vd-paper .vd-select, .vd-paper .vd-textarea { color: #101826; background: #fff; border-color: rgba(16,24,38,.28); }
.vd-paper .vd-input::placeholder, .vd-paper .vd-textarea::placeholder { color: #8a97a8; }
.vd-paper .vd-btn--ghost { color: #101826; border-color: rgba(16,24,38,.28); }
.vd-paper .vd-nav-chevron { color: #48566a; }
/* opaque fallback where the platform can't blur, so text never sits on a busy background */
@media (prefers-reduced-transparency: reduce) {
  .vd-card { background: var(--vd-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* keep the inverted "next" card its own solid colour (already opaque) so its ink stays readable */
  .vd-card--next { background: var(--vd-invert-bg); border-color: var(--vd-invert-bg); }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .vd-card { background: var(--vd-surface); }
  .vd-card--next { background: var(--vd-invert-bg); border-color: var(--vd-invert-bg); }
}

.vd-section-label {
  font-size: var(--vd-fs-sm); font-weight: 700; letter-spacing: var(--vd-track-label);
  color: var(--vd-ink-soft); text-transform: uppercase;
}
.vd-muted { color: var(--vd-ink-soft); }
.vd-h1 { font-size: var(--vd-fs-h1); font-weight: 700; letter-spacing: var(--vd-track-tight); line-height: 1.15; }
.vd-h2 { font-size: var(--vd-fs-h2); font-weight: 700; letter-spacing: -.02em; }
.vd-hero { font-size: var(--vd-fs-hero); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.vd-qty  { font-size: var(--vd-fs-qty); font-weight: 500; letter-spacing: -.04em; }

/* ---- stepper: 58px square controls, tabular readout ---- */
.vd-stepper { display: flex; align-items: center; gap: var(--vd-space-3); }
.vd-step {
  flex: none; width: var(--vd-stepper); height: var(--vd-stepper);
  border-radius: var(--vd-radius); background: var(--vd-field);
  border: 1px solid rgba(16,24,38,.28); color: var(--vd-ink);
  font-size: 26px; line-height: 1; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--vd-dur-press);
}
[data-theme="night"] .vd-step { border-color: var(--vd-hairline); }
.vd-step:active { background: rgba(16,24,38,.10); }
.vd-stepper-val {
  min-width: 58px; text-align: right; font-size: var(--vd-fs-qty);
  font-weight: 500; letter-spacing: -.04em;
}
.vd-stepper-row { display: flex; align-items: center; gap: var(--vd-space-3); }
.vd-stepper-row > .vd-label { flex: 1; font-size: var(--vd-fs-body); }

/* ---- buttons; touch targets ---- */
.vd-btn {
  height: var(--vd-touch-min); min-height: var(--vd-touch-min);
  border-radius: var(--vd-radius); border: none; cursor: pointer;
  font-size: var(--vd-fs-body); font-weight: 700; padding: 0 var(--vd-space-5);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--vd-dur-press);
}
.vd-btn--primary {
  height: var(--vd-touch-primary); width: 100%;
  background: var(--vd-action); color: var(--vd-action-ink);
  font-size: var(--vd-fs-h2);
  border: 1px solid var(--vd-action-press);   /* a contour, so it reads as canonical with the cards */
}
.vd-btn--primary:active { background: var(--vd-action-press); }
.vd-btn--ghost {
  background: transparent; color: var(--vd-ink);
  border: 1px solid rgba(16,24,38,.32);
}
[data-theme="night"] .vd-btn--ghost { border-color: var(--vd-hairline); }
.vd-btn--ghost:active { background: rgba(16,24,38,.08); }
.vd-btn--dark { background: var(--vd-invert-bg); color: var(--vd-invert-ink); }
.vd-btn--danger-link {
  background: transparent; color: var(--vd-ink-soft);
  text-decoration: underline; text-underline-offset: 4px;
}
/* Disabled/complete buttons: a solid, legible muted state (NOT a faded translucent one that washes
   out and loses contrast — worst in night). Uniform across the whole app, adapts to both themes. */
.vd-btn:disabled, .vd-btn[disabled] {
  cursor: default; opacity: 1;
  background: var(--vd-surface-2); color: var(--vd-ink-soft);
  border: 1px solid var(--vd-edge); box-shadow: none;
}

/* ---- glass: allowed on exactly two layers — header and action bar. Never behind a figure. ---- */
.vd-glass-header {
  background: var(--vd-glass); backdrop-filter: var(--vd-glass-blur);
  -webkit-backdrop-filter: var(--vd-glass-blur);
  border-bottom: 1px solid var(--vd-hairline);
}
.vd-glass-foot {
  background: var(--vd-glass-foot); backdrop-filter: var(--vd-glass-blur);
  -webkit-backdrop-filter: var(--vd-glass-blur);
  border-top: 1px solid var(--vd-hairline);
}
@media (prefers-reduced-transparency: reduce) {
  .vd-glass-header { background: var(--vd-surface); }
  .vd-glass-foot { background: var(--vd-surface); }
}

/* ---- deviation rule (attention) — a rule, plus a word in the content ---- */
.vd-rule-attn { border-top: 2px solid var(--vd-attention); }
.vd-hairline { border-top: 1px solid var(--vd-hairline); }

/* ---- pills / badges ---- */
.vd-pill {
  font-size: var(--vd-fs-sm); font-weight: 700; padding: 4px 10px;
  border-radius: var(--vd-radius); border: 1px solid var(--vd-edge);
}
.vd-pill--ok { border-color: var(--vd-ok); }
.vd-pill--cash { border-color: var(--vd-attention); letter-spacing: var(--vd-track-label); }

/* ---- inputs ---- */
.vd-field { display: block; margin-bottom: var(--vd-space-4); }
.vd-field > label {
  display: block; font-size: var(--vd-fs-sm); font-weight: 600;
  color: var(--vd-ink-soft); margin-bottom: 6px;
}
.vd-input, .vd-select, .vd-textarea {
  width: 100%; font-family: inherit; font-size: var(--vd-fs-body);
  color: var(--vd-ink); background: var(--vd-surface);
  border: 1px solid var(--vd-edge); border-radius: var(--vd-radius);
  padding: 0 var(--vd-space-4); height: var(--vd-touch-min);
}
.vd-textarea { height: auto; min-height: 88px; padding: var(--vd-space-3) var(--vd-space-4); resize: vertical; }
/* Strip the browser's native search chrome (rounded "pill" + clear button) so search fields render as
   canonical .vd-input boxes — same radius (--vd-radius), colour and height as every other field. */
.vd-input[type="search"] { -webkit-appearance: none; appearance: none; height: var(--vd-touch-min); min-height: var(--vd-touch-min); box-sizing: border-box; line-height: normal; }
.vd-input[type="search"]::-webkit-search-decoration,
.vd-input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---- tables (admin) ---- */
.vd-table { width: 100%; border-collapse: collapse; font-size: var(--vd-fs-admin); }
.vd-table th {
  text-align: left; font-size: 11px; letter-spacing: var(--vd-track-label);
  text-transform: uppercase; color: var(--vd-ink-soft);
  padding: 8px 10px; border-bottom: 1px solid var(--vd-edge); font-weight: 700;
}
.vd-table td { padding: 8px 10px; border-bottom: 1px solid var(--vd-hairline); }
.vd-table tr:hover td { background: rgba(16,24,38,.03); }
.vd-flag-warn { color: var(--vd-attention); font-weight: 700; }
.vd-flag-fail { color: var(--vd-fail); font-weight: 700; }
.vd-flag-ok { color: var(--vd-ok); font-weight: 700; }

/* ---- toasts ---- */
.vd-toasts { position: fixed; left: 0; right: 0; bottom: 88px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; }
.vd-toast {
  background: var(--vd-invert-bg); color: var(--vd-invert-ink);
  padding: 12px 18px; border-radius: var(--vd-radius); font-size: var(--vd-fs-sm);
  max-width: 340px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  animation: vd-toast-in 200ms var(--vd-ease);
}
.vd-toast.out { opacity: 0; transition: opacity 300ms; }
@keyframes vd-toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- bottom sheet (service-request, confirmations) ---- */
.vd-sheet-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(6,14,28,.52); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: vd-fade-in 160ms var(--vd-ease);
}
.vd-sheet {
  width: 100%; max-width: 520px; box-sizing: border-box;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -18px 60px rgba(9,20,40,.42);
  animation: vd-sheet-up 220ms var(--vd-ease);
}
@media (min-width: 560px) { .vd-sheet-overlay { align-items: center; } .vd-sheet { border-radius: 20px; margin: 16px; } }
@keyframes vd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes vd-sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---- theme three-position control ---- */
.vd-theme-seg { display: inline-flex; border: 1px solid var(--vd-edge); border-radius: var(--vd-radius); overflow: hidden; }
.vd-theme-seg button { background: transparent; border: none; color: var(--vd-ink-soft); font-size: var(--vd-fs-sm); padding: 8px 14px; cursor: pointer; }
.vd-theme-seg button[aria-pressed="true"] { background: var(--vd-invert-bg); color: var(--vd-invert-ink); font-weight: 700; }

/* update-available banner (admin/portal single-page apps) */
.vd-update-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--vd-invert-bg); color: var(--vd-invert-ink);
  font-size: 16px; font-weight: 600; box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}
.vd-update-bar button { flex: none; height: 44px; padding: 0 18px; border: none; border-radius: var(--vd-radius); background: var(--vd-action); color: var(--vd-action-ink); font-weight: 700; font-size: 16px; cursor: pointer; }
