/* JetBrains Mono — self-hosted variable font (cyrillic + latin), served from
   /static/fonts/. Replaces a render-blocking <link> to fonts.googleapis.com:
   guests in Russia reach Google inconsistently without a VPN. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/static/fonts/jetbrains-mono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/static/fonts/jetbrains-mono-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;
}

/* SHARED guest-css — brand-neutral. All brand values are CSS variables
   overridden by /brand/brand.css (frontend/brands/<hotel>/brand.css).
   :root values below are placeholders so a missing brand.css is obvious.
   Dark mode: follows phone system setting (prefers-color-scheme)
   ============================================================ */

:root {
  --brand:         #5A6472; /* placeholder */
  --brand-deep:    #3E4650; /* placeholder */
  --brand-soft:    #8A94A2; /* placeholder */
  --brand-rgb:     90,100,114; /* r,g,b of --brand, for rgba() shadows/glows */
  --text-on-brand: #FFFFFF;

  --bg-page:        #F4F4F2; /* placeholder */
  --bg-card:        #FFFFFF;
  --bg-soft:        #F0F0EE; /* placeholder */
  --surface:        #FFFFFF;
  --surface-h:      #F0F0EC;

  --text:           #2A2A2A; /* placeholder */
  --muted:          #6B6862;
  --muted-soft:     #B0ADA5;
  --charcoal:       #1E1E1E;
  --white:          #FFFFFF;

  --line:           #E5E5E0;
  --line-strong:    #D4D2CC;

  --paid:           #2E7D4F;
  --pending:        #D4A24A;
  --unpaid:         #B91C1C;

  --shadow:         0 24px 64px rgba(30,30,30,0.08);
  --shadow-sm:      0 4px 16px rgba(30,30,30,0.05);
  --shadow-md:      0 8px 24px rgba(30,30,30,0.07);

  --msg-error-bg:     #FEF2F2;
  --msg-error-border: #FECACA;
  --msg-info-bg:      #F0F0EC;
  --msg-info-border:  #D4D2CC;

  --radius-lg:      18px;
  --radius-md:      12px;
  --radius-sm:      8px;

  /* Topbar + cobrand + logo sizing — per-brand via brand.css */
  --topbar-bg:             rgba(20,20,20,0.85);
  --topbar-bg-scrolled:    rgba(10,10,10,0.93);
  --topbar-solid:          #141414;
  --topbar-solid-scrolled: #0A0A0A;
  --topbar-border:         rgba(255,255,255,0.15);
  --topbar-inset:          rgba(255,255,255,0.18);
  --cobrand-accent:        #FFFFFF;
  --logo-h:                24px;
  --logo-h-sm:             20px;

  --font-display:   system-ui, -apple-system, sans-serif; /* placeholder — brand.css @imports the real face */
  --font-body:      system-ui, -apple-system, sans-serif; /* placeholder */
  --font-mono:      'JetBrains Mono', monospace;

  --ease-out:       cubic-bezier(0.16,1,0.3,1);
  --ease-in-out:    cubic-bezier(0.65,0,0.35,1);
  --dur-fast:       180ms;
  --dur-base:       260ms;
  --dur-slow:       380ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page:        #141414;
    --bg-card:        #1E1E1E;
    --bg-soft:        #282828;
    --surface:        #1E1E1E;
    --surface-h:      #2A2A2A;
    --text:           #F0F0EC;
    --muted:          #9A9790;
    --muted-soft:     #5A5850;
    --charcoal:       #F0F0EC;
    --white:          #F0F0EC;
    --line:           #333330;
    --line-strong:    #444440;
    --shadow:         0 24px 64px rgba(0,0,0,0.40);
    --shadow-sm:      0 4px 16px rgba(0,0,0,0.24);
    --shadow-md:      0 8px 24px rgba(0,0,0,0.32);
    --msg-error-bg:     #2A1515;
    --msg-error-border: #7F1D1D;
    --msg-info-bg:      #282828;
    --msg-info-border:  #444440;
  }
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html,body { width:100%; overflow-x:clip; }
body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width:100%; height:auto; display:block; }

.topbar {
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--topbar-border);
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.topbar.scrolled {
  background: var(--topbar-bg-scrolled);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  backdrop-filter: blur(36px) saturate(200%);
  box-shadow: inset 0 1px 0 var(--topbar-inset), 0 8px 24px rgba(0,0,0,0.32);
}
@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))) {
  .topbar { background:var(--topbar-solid); }
  .topbar.scrolled { background:var(--topbar-solid-scrolled); }
}

.brand-wrap { display:inline-flex; flex-direction:column; align-items:center; gap:3px; }
.brand-city { font-family:var(--font-body); font-size:9px; font-weight:500; letter-spacing:0.35em; text-transform:uppercase; color:#FFFFFF; line-height:1; padding-left:0.35em; }
.topbar-logo { height:var(--logo-h); width:auto; display:block; }
.brand-mark, .brand, .brand-sub { display:none; }

.cobrand-powered {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 10px;
  color: rgba(240,240,236,0.45);
  letter-spacing: 0.04em;
}
.cobrand-powered svg rect { fill: var(--cobrand-accent); }
.cobrand-powered .fp-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  color: var(--cobrand-accent);
  letter-spacing: 0.01em;
}

/* Offline banner — amber kept as safety convention */
.offline-banner {
  width: min(100% - 32px, 960px);
  margin: 16px auto;
  background: #FFF7E6;
  border: 2px solid #F59E0B;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: 0 8px 24px rgba(245,158,11,0.15);
}
.offline-banner-inner { display:flex; align-items:flex-start; gap:14px; }
.offline-banner-icon { font-size:24px; color:#D97706; line-height:1; }
.offline-banner-body { flex:1; }
.offline-banner-title { font-family:var(--font-display); font-weight:500; font-size:14px; color:#92400E; line-height:1.4; margin-bottom:4px; }
.offline-banner-sub { font-family:var(--font-body); font-size:13px; color:#78350F; line-height:1.5; }
.offline-banner-sub a { color:#92400E; text-decoration:none; font-weight:600; }
.offline-banner-sub a:hover { text-decoration:underline; }

.container {
  width: min(100% - 32px, 720px);
  margin: 32px auto 56px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  animation: fade-in-up var(--dur-slow) var(--ease-out) both;
}

.hero { margin-bottom:28px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px,4.5vw,40px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text);
}
.subtitle { margin-top:10px; font-size:14px; color:var(--muted); line-height:1.5; }

.plate-box,.keyboard-box,.photo-search-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 14px;
  position: relative;
  animation: fade-in-up var(--dur-base) var(--ease-out) both;
}
.plate-box  { animation-delay:80ms; }
.keyboard-box { animation-delay:160ms; }

.plate-label,.keyboard-title {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 12px;
  display: block;
}

.plate-input-wrap {
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.plate-input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb),0.15);
}
.plate-input-wrap.invalid-flash { animation: invalid-char-flash 320ms var(--ease-out); }

#plateInput {
  width:100%; border:none; outline:none; background:transparent;
  font-family: var(--font-mono);
  font-size: 28px; font-weight:500; letter-spacing:0.05em;
  text-align:center; color:var(--text); text-transform:uppercase;
}
#plateInput::placeholder {
  font-size:14px; font-family:var(--font-body); font-weight:400;
  letter-spacing:0; color:var(--muted-soft); text-transform:none;
}
.plate-hint { font-size:11px; color:var(--muted); margin-top:8px; text-align:center; line-height:1.4; }
.plate-hint code { font-family:var(--font-mono); font-size:10px; color:var(--muted); letter-spacing:0.5px; }

.autocomplete-dropdown {
  position:absolute; top:calc(100% - 6px); left:22px; right:22px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-md); box-shadow:var(--shadow-md);
  z-index:100; overflow:hidden;
  animation: fade-in-down var(--dur-fast) var(--ease-out) both;
}
.autocomplete-item {
  padding:13px 18px; font-family:var(--font-mono); font-size:14px;
  font-weight:500; letter-spacing:0.04em; cursor:pointer;
  border-bottom:1px solid var(--line);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  color:var(--text);
}
.autocomplete-item:last-child { border-bottom:none; }
.autocomplete-item:hover { background:var(--surface-h); color:var(--brand-deep); }

.plate-actions,.guest-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }

button {
  border:none; border-radius:var(--radius-md); cursor:pointer;
  font-family:var(--font-body); font-weight:500; font-size:14px;
  transition: all var(--dur-base) var(--ease-out); min-height:46px;
}
button:active { transform:scale(0.98); }

.btn-primary {
  flex:1 1 200px; padding:14px 20px;
  background:var(--brand); color:var(--text-on-brand);
  font-family:var(--font-display); font-size:14px; font-weight:600;
  letter-spacing:0.02em;
  box-shadow:0 6px 18px rgba(var(--brand-rgb),0.25);
}
.btn-primary:hover { background:var(--brand-deep); transform:translateY(-1px); box-shadow:0 10px 26px rgba(var(--brand-rgb),0.32); }
.btn-primary:disabled { opacity:0.5; cursor:not-allowed; transform:none; }

.btn-secondary { flex:1 1 140px; padding:11px 16px; background:var(--surface); color:var(--muted); border:1px solid var(--line); }
.btn-secondary:hover { background:var(--surface-h); color:var(--text); border-color:var(--line-strong); }

.btn-ghost {
  flex:1 1 200px; padding:13px 20px; background:transparent;
  color:var(--text); border:1.5px solid var(--line-strong);
  font-family:var(--font-display); font-size:13px; font-weight:500; letter-spacing:0.02em;
}
.btn-ghost:hover { background:var(--surface-h); border-color:var(--brand); }

.btn-pay {
  width:100%; margin-top:18px; padding:17px;
  background:var(--brand); color:var(--text-on-brand);
  font-family:var(--font-display); font-size:15px; font-weight:600; letter-spacing:0.02em;
  box-shadow:0 8px 24px rgba(var(--brand-rgb),0.28);
}
.btn-pay:hover { background:var(--brand-deep); transform:translateY(-1px); box-shadow:0 12px 30px rgba(var(--brand-rgb),0.35); }
.btn-pay:disabled { opacity:0.5; cursor:not-allowed; transform:none; }

body.payments-offline .btn-pay { background:var(--surface-h)!important; color:var(--muted)!important; cursor:not-allowed; box-shadow:none!important; }
body.payments-offline .btn-pay:hover { transform:none!important; box-shadow:none!important; background:var(--surface-h)!important; }

.btn-not-my-car { width:100%; margin-top:10px; padding:11px; background:transparent; color:var(--muted); border:1px solid var(--line); font-size:13px; }
.btn-not-my-car:hover { background:var(--surface-h); color:var(--text); }

.btn-select { width:100%; margin-top:12px; padding:12px; background:var(--brand); color:var(--text-on-brand); font-family:var(--font-display); font-size:13px; font-weight:600; letter-spacing:0.02em; }
.btn-select:hover { background:var(--brand-deep); }

.photo-search-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.photo-search-head h2 { font-family:var(--font-display); font-size:20px; font-weight:500; letter-spacing:-0.01em; margin-bottom:4px; color:var(--text); }
.photo-search-head p { font-size:13px; color:var(--muted); }

.photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.photo-loading { grid-column:1/-1; text-align:center; padding:40px; color:var(--muted); }

.car-card {
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-md); overflow:hidden; box-shadow:var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  animation: fade-in-up var(--dur-base) var(--ease-out) both;
}
.car-card { animation-delay:calc(var(--i,0) * 55ms); }
.car-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.car-card img { width:100%; height:160px; object-fit:cover; }
.car-card-body { padding:13px; }
.car-card-time { font-size:11px; color:var(--muted); margin-bottom:4px; }
.car-card-amount { font-family:var(--font-mono); font-size:17px; font-weight:500; color:var(--text); margin-bottom:2px; }
.car-card-status { font-size:12px; color:var(--paid); font-weight:500; margin-bottom:10px; }

#resultSection { margin-top:18px; }
.result-card {
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); padding:24px; box-shadow:var(--shadow-md);
  animation: fade-in-up var(--dur-base) var(--ease-out) both;
}
.result-title { font-size:10px; font-weight:600; letter-spacing:0.15em; text-transform:uppercase; color:var(--brand-deep); margin-bottom:16px; }

.result-row { display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid var(--line); font-size:14px; }
.result-row:last-of-type { border-bottom:none; }
.result-row .lbl { color:var(--muted); }
.result-row .val { font-weight:500; color:var(--text); }
.result-row .val.mono { font-family:var(--font-mono); }

.result-photo { width:100%; border-radius:var(--radius-md); margin:14px 0; max-height:240px; object-fit:cover; }
.result-amount-label { font-size:10px; font-weight:600; letter-spacing:0.15em; text-transform:uppercase; color:var(--muted); text-align:left; margin-top:18px; margin-bottom:4px; }
.result-amount { font-family:var(--font-display); font-size:42px; font-weight:400; color:var(--text); letter-spacing:-0.02em; text-align:left; padding:0 0 8px; }
.result-amount .rub { font-weight:300; color:var(--muted); font-size:30px; }

/* 54-FZ phone field — legally required, border stays prominent */
.phone-wrap {
  margin-top:16px; padding:16px 18px;
  background:var(--bg-card); border-radius:var(--radius-md);
  border:2px solid var(--brand);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.phone-wrap:focus-within { box-shadow:0 0 0 4px rgba(var(--brand-rgb),0.15); }
.phone-wrap label { display:block; font-size:10px; font-weight:600; color:var(--brand-deep); text-transform:uppercase; letter-spacing:0.12em; margin-bottom:8px; }
.phone-wrap input { width:100%; border:1px solid var(--line); border-radius:var(--radius-sm); padding:11px 14px; font-family:var(--font-mono); font-size:16px; outline:none; background:var(--surface); color:var(--text); transition:border-color var(--dur-fast) var(--ease-out); }
.phone-wrap input:focus { border-color:var(--brand); }
.phone-hint { font-size:11px; color:var(--muted); margin-top:6px; }

.msg-error,.msg-info { border-radius:var(--radius-md); padding:13px 18px; font-weight:500; font-size:14px; margin-top:14px; animation:fade-in-up var(--dur-fast) var(--ease-out) both; }
.msg-error { background:var(--msg-error-bg); border:1px solid var(--msg-error-border); color:#B91C1C; }
.msg-info { background:var(--msg-info-bg); border:1px solid var(--msg-info-border); color:var(--muted); }

.privacy-footer { text-align:center; margin:32px auto 0; padding:14px 0; }
.privacy-footer a { font-size:11px; color:var(--muted); text-decoration:none; letter-spacing:0.02em; border-bottom:1px dotted var(--muted-soft); padding-bottom:2px; transition:color var(--dur-fast) var(--ease-out); }
.privacy-footer a:hover { color:var(--brand-deep); }

.hidden { display:none!important; }

@keyframes fade-in-up { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes fade-in-down { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes invalid-char-flash {
  0%   { border-color:var(--line-strong); }
  30%  { border-color:var(--brand); box-shadow:0 0 0 4px rgba(var(--brand-rgb),0.18); }
  100% { border-color:var(--line-strong); box-shadow:0 0 0 0 rgba(var(--brand-rgb),0); }
}
@keyframes skeleton-pulse { 0%,100% { opacity:0.55; } 50% { opacity:0.85; } }
.skeleton { background:var(--bg-soft); border-radius:var(--radius-sm); animation:skeleton-pulse 1.5s var(--ease-in-out) infinite; }

@media (max-width:640px) {
  .topbar { padding:12px 18px; flex-wrap:wrap; gap:10px; }
  .topbar-logo { height:var(--logo-h-sm); }
  .container { width:calc(100% - 20px); padding:22px 18px; border-radius:16px; margin-top:16px; }
  .hero h1 { font-size:26px; }
  .plate-box,.photo-search-box { padding:18px 16px; }
  #plateInput { font-size:24px; }
  .plate-actions,.guest-actions { flex-direction:column; }
  .btn-primary,.btn-ghost,.btn-secondary { flex:none; width:100%; }
  .photo-grid { grid-template-columns:1fr; }
  .result-card { padding:20px 18px; }
  .result-amount { font-size:36px; }
  .offline-banner { width:calc(100% - 20px); padding:12px 14px; border-radius:14px; }
}
@media (max-width:400px) {
  .hero h1 { font-size:22px; }
  #plateInput { font-size:22px; }
  .result-amount { font-size:32px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:0.01ms!important; transition-duration:0.01ms!important; }
}
