/* banicharka.bg — Rental Ops
   Dark, rugged, high-contrast for outdoor sunlight readability.
   Cyrillic-first. Bulgarian number format (1 250,00 €). */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&display=swap');

:root {
  /* Backgrounds */
  --bg-0: #0A0D12;
  --bg-1: #111620;
  --bg-2: #1A2130;
  --bg-3: #232C3D;
  --bg-4: #2D384E;

  /* Borders */
  --border: #2A3446;
  --border-strong: #3A465E;

  /* Text */
  --text-0: #F4F6FB;
  --text-1: #B4BECF;
  --text-2: #7A8699;
  --text-3: #4E5A70;

  /* Accent — banicharka cobalt (from van decals) */
  --accent: #1A5CE6;
  --accent-hover: #3B76F0;
  --accent-tint: rgba(26, 92, 230, 0.14);
  --accent-tint-strong: rgba(26, 92, 230, 0.25);

  /* Status */
  --green: #22C55E;
  --green-tint: rgba(34, 197, 94, 0.16);
  --yellow: #F5A524;
  --yellow-tint: rgba(245, 165, 36, 0.16);
  --red: #EF4444;
  --red-tint: rgba(239, 68, 68, 0.16);
  --blue: #3B76F0;
  --blue-tint: rgba(59, 118, 240, 0.16);
  --gray: #7A8699;
  --gray-tint: rgba(122, 134, 153, 0.16);

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 6px 20px rgba(0,0,0,0.35);

  /* Font stacks */
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-serif: 'Source Serif 4', 'Charter', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  background: #05070B;
  color: var(--text-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

input, textarea, select {
  font-family: inherit;
  color: inherit;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }

/* App stage: center the device frame on a subtle backdrop */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 800px at 50% -10%, #0f1420 0%, #05070B 60%),
    #05070B;
}

/* Tablet frame — 10" landscape, ~1280×800 */
.frame-tablet {
  width: 1280px;
  height: 800px;
  border-radius: 24px;
  background: #000;
  padding: 14px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 2px #1a1a1a;
  position: relative;
  transform-origin: center;
}
.frame-tablet .screen {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-0);
  position: relative;
}
.frame-tablet .cam {
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1f2a;
}

/* Phone frame — 6", ~390×844 */
.frame-phone {
  width: 390px;
  height: 844px;
  border-radius: 44px;
  background: #000;
  padding: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 2px #1a1a1a;
  position: relative;
  transform-origin: center;
}
.frame-phone .screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: var(--bg-0);
  position: relative;
}
.frame-phone .notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 26px;
  background: #000;
  border-radius: 14px;
  z-index: 50;
  pointer-events: none;
}

/* Stage 1C: installed-PWA override — the .stage/.frame-tablet/
   .frame-phone rig above is a DESIGN-PREVIEW device mockup (fake
   bezel, fixed nominal size, JS-scaled to fit a desktop browser
   viewport). Correct there; wrong on a real installed PWA, where it
   would render as a fake tablet bezel shrunk down inside the user's
   actual tablet screen. `display-mode: standalone` (and the older
   `fullscreen`) are TRUE only when launched from an installed PWA
   icon, never in an ordinary browser tab — so this strips the
   decorative frame/backdrop and lets .screen's content go full-bleed
   ONLY in that context. Zero effect on the normal browser-tab
   experience (dev, testing, or anyone who never installs the PWA). */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .stage {
    padding: 0;
    background: var(--bg-0);
  }
  /* .stage's direct child is the div[data-user-scale] wrapper that
     autoScaleStage() applies its inline `transform: scale(...)` to
     (see app.jsx: container = stage.firstElementChild). Overriding
     the transform here, on that same element via the attribute
     selector, is required — overriding .frame-tablet/.frame-phone
     (one level deeper) would NOT touch the inline style actually set
     on this wrapper. */
  .stage > [data-user-scale] {
    transform: none !important;
    width: 100vw;
    height: 100vh;
  }
  .frame-tablet, .frame-phone {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    background: var(--bg-0);
    padding: 0;
    box-shadow: none;
  }
  .frame-tablet .screen, .frame-phone .screen {
    border-radius: 0;
  }
  .frame-tablet .cam, .frame-phone .notch {
    display: none;
  }
}

/* App content root inside screen */
.app {
  width: 100%;
  height: 100%;
  display: flex;
  background: var(--bg-0);
  color: var(--text-0);
  position: relative;
  overflow: hidden;
}

/* Utility */
.hstack { display: flex; align-items: center; }
.vstack { display: flex; flex-direction: column; }
.grow { flex: 1 1 auto; min-width: 0; }
.no-scroll { overflow: hidden; }
.scroll-y { overflow-y: auto; overflow-x: hidden; }
.scroll-x { overflow-x: auto; overflow-y: hidden; }

.dim { color: var(--text-1); }
.dimmer { color: var(--text-2); }
.upcase { text-transform: uppercase; letter-spacing: 0.06em; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Kiosk (customer-facing) light theme container */
.kiosk {
  background: #F7F6F2;
  color: #0F1420;
  font-family: var(--font-ui);
}
.kiosk h1, .kiosk h2, .kiosk .serif {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
}

/* Signature pad canvas */
.sigpad {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* Placeholder stripes (image slots) */
.img-placeholder {
  background:
    repeating-linear-gradient(
      45deg,
      #1a2130 0px, #1a2130 8px,
      #141a26 8px, #141a26 16px
    );
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Wizard progress steps */
.stepdots {
  display: flex;
  gap: 6px;
}
.stepdots .d {
  flex: 1;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  transition: background 0.2s;
}
.stepdots .d.active { background: var(--accent); }
.stepdots .d.done { background: var(--green); }

/* Nice text selection */
::selection { background: var(--accent); color: white; }
