* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #123b63;
  --navy-deep: #082844;
  --blue: #206ed4;
  --blue-soft: #e7f0ff;
  --mint: #50b6a8;
  --mint-soft: #def4ef;
  --amber: #d99329;
  --red: #d44848;
  --ink: #152534;
  --muted: #6b7a88;
  --line: #dce4ea;
  --paper: #fff;
  --canvas: #f3f6f8;
  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(21, 52, 77, .12);
}

html { min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body { min-height: 100vh; min-height: 100dvh; color: var(--ink); background: var(--canvas); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(32, 110, 212, .28); outline-offset: 3px; }
[hidden] { display: none !important; }

.public-header { max-width: 1120px; height: 82px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy-deep); text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 12px 12px 12px 4px; font-size: 22px; font-weight: 800; }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font-size: 15px; font-weight: 800; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.account-link { min-height: 42px; border: 0; border-bottom: 1px solid currentColor; color: var(--navy); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; }
.header-actions { display: flex; align-items: center; gap: 13px; }
.install-app-btn { min-height: 40px; padding: 0 14px; color: white; background: var(--navy); border: 0; border-radius: 11px; font-size: 11px; font-weight: 800; cursor: pointer; }
.connection-status { padding: 6px 9px; color: #934343; background: #fdeaea; border-radius: 8px; font-size: 10px; font-weight: 800; }
.is-standalone .install-app-btn { display: none !important; }

.app-shell { width: 100%; }
.screen { display: none; }
.screen.active { display: block; animation: screen-in .35s cubic-bezier(.2,.7,.2,1); }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.guest-screen { max-width: 1120px; margin: 0 auto; padding: 28px 28px 80px; }
.guest-hero { position: relative; min-height: 470px; padding: 72px 58px; overflow: hidden; color: white; background: var(--navy-deep); border-radius: var(--radius-lg); isolation: isolate; }
.guest-hero::before { content: ''; position: absolute; width: 520px; height: 520px; right: -100px; top: -120px; border: 86px solid rgba(80,182,168,.25); border-radius: 50%; z-index: -1; }
.guest-hero::after { content: 'P'; position: absolute; right: 74px; bottom: -75px; color: rgba(255,255,255,.07); font-size: 360px; font-weight: 800; line-height: 1; z-index: -1; }
.eyebrow { color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.guest-hero h1 { max-width: 610px; margin: 17px 0 16px; font-size: clamp(42px, 6vw, 72px); line-height: .98; letter-spacing: -.055em; }
.guest-hero > p { max-width: 460px; color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.6; }
.btn { min-height: 54px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 14px; font-weight: 800; cursor: pointer; transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { cursor: wait; opacity: .6; transform: none; }
.btn-primary { color: white; background: var(--blue); }
.btn-primary:hover { background: #175fc0; }
.btn-secondary { color: var(--navy); background: white; border: 1px solid var(--line); }
.btn-success { color: white; background: var(--mint); }
.btn-glass { color: white; background: rgba(255,255,255,.16); }
.guest-cta { min-width: 250px; margin-top: 32px; background: var(--mint); }
.guest-cta:hover { background: #42a799; }
.guest-cta span { font-size: 22px; }
.trust-row { position: absolute; left: 58px; bottom: 34px; display: flex; gap: 24px; color: rgba(255,255,255,.67); font-size: 11px; font-weight: 600; }
.trust-row span::before { content: '✓'; margin-right: 7px; color: var(--mint); font-weight: 800; }

.public-map-section { margin-top: 22px; padding: 38px 40px 40px; background: white; border-radius: var(--radius-lg); }
.map-section-heading { margin-bottom: 24px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.map-section-heading h2 { margin-top: 8px; color: var(--navy-deep); font-size: clamp(27px, 4vw, 42px); letter-spacing: -.04em; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; color: var(--muted); font-size: 11px; font-weight: 700; }
.map-legend span::before { content: ''; width: 8px; height: 8px; margin-right: 6px; display: inline-block; border-radius: 50%; }
.map-legend .available::before { background: #3478f6; }
.map-legend .limited::before { background: var(--amber); }
.map-legend .full::before { background: var(--red); }
.guest-map { position: relative; height: 430px; overflow: hidden; background: #e8eef1; border-radius: 22px; }
.map-surface { isolation: isolate; }
.map-loading { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.parking-map-fallback { height: 100%; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; background-color: #e5edf1; background-image: linear-gradient(28deg, transparent 48%, rgba(255,255,255,.9) 49%, rgba(255,255,255,.9) 52%, transparent 53%), linear-gradient(120deg, transparent 46%, #c5d4dc 47%, #c5d4dc 49%, transparent 50%); background-size: 120px 90px, 170px 130px; }
.fallback-map-title { margin-bottom: auto; padding: 13px 15px; width: fit-content; color: var(--navy); background: rgba(255,255,255,.92); border-radius: 13px; box-shadow: 0 8px 24px rgba(18,59,99,.12); }
.fallback-map-title strong, .fallback-map-title small { display: block; }
.fallback-map-title small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.fallback-map-points { display: flex; flex-wrap: wrap; gap: 7px; }
.fallback-map-point { min-height: 42px; padding: 7px 10px; color: var(--navy); background: rgba(255,255,255,.94); border: 1px solid white; border-radius: 11px; box-shadow: 0 6px 18px rgba(18,59,99,.11); text-align: left; cursor: pointer; }
.fallback-map-point strong, .fallback-map-point small { display: block; }
.fallback-map-point strong { font-size: 10px; }
.fallback-map-point small { margin-top: 2px; color: #238c7d; font-size: 9px; }
.fallback-map-point.full small { color: var(--red); }
.parking-balloon { min-width: 190px; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; }
.parking-balloon strong, .parking-balloon span { display: block; }
.parking-balloon strong { color: var(--navy-deep); font-size: 14px; }
.parking-balloon span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.parking-balloon b { display: inline-block; margin-top: 9px; color: var(--blue); font-size: 12px; }
.parking-balloon button { width: 100%; min-height: 38px; margin-top: 11px; color: white; background: var(--navy); border: 0; border-radius: 9px; font-size: 11px; font-weight: 800; cursor: pointer; }
.parking-balloon button:disabled { color: var(--muted); background: var(--line); cursor: not-allowed; }
.parking-price-badge { min-width: 76px; height: 36px; padding: 0 12px; display: grid; place-items: center; color: #174c91; background: white; border: 3px solid #3478f6; border-radius: 18px; box-shadow: 0 5px 16px rgba(18,59,99,.22); font: 800 13px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; white-space: nowrap; cursor: pointer; }
.parking-price-badge--limited { color: #8b5700; border-color: #f2a93b; }
.parking-price-badge--full { color: #a22f2f; border-color: #e25555; }

.how-it-works { padding: 82px 58px 20px; }
.section-heading h2 { margin-top: 9px; color: var(--navy-deep); font-size: clamp(30px, 4vw, 46px); letter-spacing: -.04em; }
.section-heading > p { margin-top: 9px; color: var(--muted); line-height: 1.6; }
.steps-list { margin-top: 36px; list-style: none; border-top: 1px solid var(--line); }
.steps-list li { min-height: 96px; display: grid; grid-template-columns: 72px 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.steps-list li > span { color: var(--mint); font-size: 13px; font-weight: 800; }
.steps-list strong { color: var(--navy-deep); font-size: 18px; }
.steps-list p { margin-top: 4px; color: var(--muted); font-size: 13px; }

.account-panel { max-width: 620px; margin: 60px auto 0; padding: 44px; background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.account-panel form { margin-top: 30px; }
.form-group { margin-bottom: 17px; }
.form-label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.form-input, .form-select { width: 100%; height: 54px; padding: 0 15px; color: var(--ink); background: #f8fafb; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 16px; transition: border-color .2s, background .2s; }
.form-input:focus, .form-select:focus { background: white; border-color: var(--blue); outline: 3px solid rgba(32,110,212,.12); }
.form-switch { margin-top: 17px; color: var(--muted); text-align: center; font-size: 13px; }
.form-switch button { padding: 5px; color: var(--blue); background: none; border: 0; font-weight: 700; cursor: pointer; }

.app-screen { max-width: 520px; min-height: 100dvh; margin: 0 auto; padding: 28px 20px 112px; }
.app-topline { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; }
.app-topline h1, .page-title h1 { margin-top: 4px; color: var(--navy-deep); font-size: 28px; letter-spacing: -.04em; }
.profile-mini { width: 44px; height: 44px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 50%; font-weight: 800; }
.balance-card { min-height: 145px; padding: 25px; display: flex; align-items: flex-end; justify-content: space-between; color: white; background: var(--navy-deep); border-radius: 24px; overflow: hidden; position: relative; }
.balance-card::after { content: ''; position: absolute; width: 170px; height: 170px; right: -65px; top: -80px; border: 35px solid rgba(80,182,168,.25); border-radius: 50%; }
.balance-label { margin-bottom: 5px; color: rgba(255,255,255,.66); font-size: 12px; }
.balance-amount { font-size: 34px; font-weight: 800; letter-spacing: -.04em; }
.balance-btn { position: relative; z-index: 1; min-height: 40px; padding: 0 15px; color: white; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); border-radius: 11px; font-size: 12px; font-weight: 800; cursor: pointer; }
.active-parking { margin-top: 13px; padding: 21px; color: white; background: var(--mint); border-radius: 22px; }
.active-head { display: flex; justify-content: space-between; gap: 15px; }
.active-head div { display: flex; flex-direction: column; }
.active-head span:first-child, .active-head small { color: rgba(255,255,255,.75); font-size: 11px; }
.active-head strong { margin: 4px 0 2px; font-size: 18px; }
.status-badge { height: fit-content; padding: 5px 8px; border-radius: 8px; font-size: 10px; font-weight: 800; }
.status-badge.active { color: #187569; background: rgba(255,255,255,.72); }
.timer { margin: 19px 0 14px; display: flex; align-items: baseline; gap: 8px; }
.timer span { font-size: 31px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer small { color: rgba(255,255,255,.72); }
.compact-map-heading { margin: 22px 0 9px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.compact-map-heading strong { color: var(--navy-deep); font-size: 15px; }
.compact-map-heading span { color: var(--muted); font-size: 10px; }
.map-container { height: 280px; margin-bottom: 14px; overflow: hidden; background: #dfe8ed; border-radius: 22px; }
.section-title { margin: 31px 0 13px; display: flex; align-items: center; justify-content: space-between; }
.section-title h2 { color: var(--navy-deep); font-size: 19px; }
.section-title button { min-height: 36px; color: var(--blue); background: none; border: 0; font-size: 12px; font-weight: 800; cursor: pointer; }
.page-title { margin-top: 2px; }
.page-title span { color: var(--muted); font-size: 12px; }
.parking-list, .car-list, .history-list { display: flex; flex-direction: column; }
.parking-card { width: 100%; min-height: 90px; padding: 16px 0; display: grid; grid-template-columns: 46px 1fr auto; gap: 13px; align-items: center; color: inherit; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.parking-card:hover .parking-arrow { transform: translateX(3px); }
.parking-icon { width: 46px; height: 46px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 14px; font-weight: 800; }
.parking-name { color: var(--navy-deep); font-size: 14px; font-weight: 800; }
.parking-address { margin-top: 3px; color: var(--muted); font-size: 11px; }
.parking-meta { margin-top: 7px; display: flex; gap: 10px; font-size: 10px; font-weight: 700; }
.parking-price { color: var(--blue); }
.parking-spots { color: #238c7d; }
.parking-spots.warning { color: var(--amber); }
.parking-spots.full { color: var(--red); }
.parking-arrow { color: var(--muted); transition: transform .2s; }
.car-card { min-height: 82px; padding: 15px 0; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.car-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 14px; }
.car-number { font-size: 16px; font-weight: 800; letter-spacing: .05em; }
.car-model { margin-top: 3px; color: var(--muted); font-size: 11px; }
.car-actions { display: flex; align-items: center; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.icon-btn:hover { color: var(--blue); background: var(--blue-soft); }
.icon-btn.delete:hover { color: var(--red); background: #fdeaea; }
.empty-state { padding: 55px 20px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--navy); }
.profile-header { padding: 10px 0 24px; display: flex; align-items: center; gap: 15px; }
.profile-avatar { width: 58px; height: 58px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 18px; font-size: 21px; font-weight: 800; }
.profile-info { min-width: 0; flex: 1; }
.profile-info h1 { color: var(--navy-deep); font-size: 22px; }
.profile-info p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.profile-edit-btn { min-height: 42px; padding: 0 10px; color: var(--blue); background: transparent; border: 0; border-radius: 10px; font-size: 12px; font-weight: 800; cursor: pointer; }
.profile-edit-btn:hover { background: var(--blue-soft); }
.utility-list { border-top: 1px solid var(--line); }
.utility-list > * { min-height: 65px; display: flex; align-items: center; justify-content: space-between; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.utility-list span { color: var(--muted); font-size: 12px; }
.utility-list strong { color: var(--navy); font-size: 12px; }
.utility-list .status-online { color: #238c7d; }
.history-item { min-height: 70px; display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; border-bottom: 1px solid var(--line); }
.history-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-weight: 800; }
.history-icon.income { color: #238c7d; background: var(--mint-soft); }
.history-icon.expense { color: var(--blue); background: var(--blue-soft); }
.history-title { font-size: 12px; font-weight: 700; }
.history-date { margin-top: 3px; color: var(--muted); font-size: 10px; }
.history-amount { font-size: 13px; font-weight: 800; }
.history-amount.income { color: #238c7d; }
.logout-btn { width: 100%; margin-top: 30px; }

.bottom-nav { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 1000; width: min(calc(100% - 24px), 480px); min-height: 68px; padding: 8px; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.94); border: 1px solid rgba(220,228,234,.8); border-radius: 22px; box-shadow: 0 16px 50px rgba(8,40,68,.16); backdrop-filter: blur(16px); transform: translateX(-50%); }
.nav-item { min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); background: none; border: 0; border-radius: 15px; cursor: pointer; }
.nav-item span { font-size: 16px; font-weight: 800; }
.nav-item small { font-size: 9px; font-weight: 700; }
.nav-item.active { color: white; background: var(--navy); }

.modal-overlay { position: fixed; inset: 0; z-index: 2000; padding: 16px; display: none; align-items: flex-end; justify-content: center; background: rgba(8,27,43,.58); backdrop-filter: blur(5px); }
.modal-overlay.active { display: flex; }
.modal { width: min(100%, 540px); max-height: min(90dvh, 760px); overflow-y: auto; background: white; border-radius: 26px 26px 16px 16px; box-shadow: var(--shadow); animation: modal-in .3s cubic-bezier(.2,.8,.2,1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(30px); } }
.modal-header { position: sticky; top: 0; z-index: 2; padding: 21px 21px 15px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); }
.modal-title { color: var(--navy-deep); font-size: 19px; font-weight: 800; }
.modal-close { width: 42px; height: 42px; display: grid; place-items: center; color: var(--muted); background: var(--canvas); border: 0; border-radius: 50%; cursor: pointer; }
.modal-body { padding: 20px 21px; }
.modal-footer { position: sticky; bottom: 0; padding: 14px 21px max(20px, env(safe-area-inset-bottom)); background: white; border-top: 1px solid var(--line); }
.modal-footer .btn { width: 100%; }
.form-input:disabled { color: var(--muted); background: var(--canvas); cursor: not-allowed; }
.form-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.modal-summary { margin-bottom: 19px; padding: 15px; display: flex; align-items: center; justify-content: space-between; color: var(--navy); background: var(--blue-soft); border-radius: 14px; }
.modal-summary span { color: var(--muted); font-size: 11px; }
.modal-summary strong { display: block; margin-top: 2px; font-size: 18px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.provider-options, .tariff-options { display: grid; gap: 8px; }
.provider-options { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.tariff-options { grid-template-columns: repeat(3, 1fr); }
.choice-option { min-height: 58px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice-option input { position: absolute; opacity: 0; pointer-events: none; }
.choice-option.selected, .choice-option:has(input:checked) { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); }
.choice-option strong { font-size: 12px; }
.choice-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.secure-note { margin-top: 18px; display: flex; gap: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.secure-note b { color: var(--mint); }
.success-modal { padding: 42px 24px 26px; text-align: center; }
.success-icon { width: 72px; height: 72px; margin: 0 auto 19px; display: grid; place-items: center; color: white; background: var(--mint); border-radius: 23px; font-size: 34px; font-weight: 800; transform: rotate(-3deg); }
.success-title { color: var(--navy-deep); font-size: 23px; font-weight: 800; }
.success-text { margin: 9px auto 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.success-cost { margin-bottom: 22px; color: var(--navy); font-size: 28px; font-weight: 800; }
.success-modal .btn { width: 100%; }
.toast { position: fixed; left: 50%; bottom: 104px; z-index: 3000; max-width: calc(100% - 32px); padding: 12px 17px; color: white; background: var(--navy-deep); border-radius: 12px; box-shadow: var(--shadow); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .public-header { height: 70px; padding: 0 18px; }
  .account-link { font-size: 11px; }
  .header-actions { gap: 8px; }
  .install-app-btn { padding: 0 10px; }
  .connection-status { display: none; }
  .guest-screen { padding: 10px 12px 60px; }
  .guest-hero { min-height: 520px; padding: 49px 25px; border-radius: 24px; }
  .guest-hero::after { right: -20px; bottom: -40px; font-size: 250px; }
  .guest-hero h1 { margin-top: 14px; font-size: 47px; }
  .guest-hero > p { font-size: 14px; }
  .guest-cta { width: 100%; }
  .trust-row { left: 25px; right: 25px; bottom: 27px; flex-wrap: wrap; gap: 9px 15px; }
  .public-map-section { padding: 26px 13px 13px; border-radius: 24px; }
  .map-section-heading { margin: 0 10px 18px; align-items: flex-start; flex-direction: column; gap: 13px; }
  .map-section-heading h2 { font-size: 29px; }
  .map-legend { justify-content: flex-start; }
  .guest-map { height: 360px; border-radius: 17px; }
  .parking-map-fallback { padding: 15px; }
  .fallback-map-points { max-height: 190px; overflow-y: auto; }
  .how-it-works { padding: 60px 13px 0; }
  .account-panel { margin-top: 45px; padding: 27px 20px; border-radius: 22px; }
  .app-screen { padding-top: 21px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .modal-overlay { padding: 0; }
  .modal { max-height: 92dvh; border-radius: 26px 26px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
