/* ==========================================================================
   SEEYOUSOON — DESIGN SYSTEM & PHASE 0 SIGNATURE COMPONENTS
   Obsidian Glassmorphism · Service Spectrum · Live Capsule · Prisbrev · StateViews
   ========================================================================== */

/* ── 1. Topbar & Utility Layouts ── */
.topbar-left { display: flex; align-items: center; gap: 8px; }
.btn-back-home {
  display: none;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--sys-label);
  gap: 6px;
  padding: 0 12px;
  width: auto;
}
.btn-back-home.is-visible { display: flex; }
.btn-back-home-label { font-size: 12px; font-weight: 900; letter-spacing: 0.2px; }
.location-chevron { display: inline-flex; align-items: center; margin-left: 4px; opacity: 0.6; }

.fallback-banner {
  display: none;
  position: fixed;
  top: calc(var(--safe-top) + 104px);
  left: 16px;
  right: 16px;
  z-index: var(--z-topbar);
  background: rgba(245, 158, 11, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #070a14;
  font-weight: 800;
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.fallback-banner.is-active { display: none; }

.city-modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 900; margin-bottom: 16px; color: var(--sys-label); }
.city-modal-list { display: flex; flex-direction: column; gap: 10px; }
.city-option-secondary { background: var(--ink-2); border: 1px solid var(--glass-border); box-shadow: none; }

/* ── 2. Glass Cards, Chips & Badges ── */
.glass-card {
  background: var(--glass-l2-bg);
  backdrop-filter: blur(var(--glass-l2-blur));
  -webkit-backdrop-filter: blur(var(--glass-l2-blur));
  border: 1px solid var(--glass-l2-border);
  box-shadow: var(--glass-specular-top), 0 8px 32px var(--sys-shadow);
  border-radius: var(--radius-xl);
}
.glass-card.glass-l1 {
  background: var(--glass-l1-bg);
  backdrop-filter: blur(var(--glass-l1-blur));
  -webkit-backdrop-filter: blur(var(--glass-l1-blur));
  border-color: var(--glass-l1-border);
}
.glass-card.glass-l3 {
  background: var(--glass-l3-bg);
  backdrop-filter: blur(var(--glass-l3-blur));
  -webkit-backdrop-filter: blur(var(--glass-l3-blur));
  border-color: var(--glass-l3-border);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--sys-film);
  border: 1px solid var(--sys-edge);
  color: var(--paper-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:active { transform: scale(0.96); }
.chip--selected {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(168, 85, 247, 0.45);
  color: var(--sys-label);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}
.chip--live { border-color: rgba(245, 158, 11, 0.4); color: var(--live); }
.chip--ok { border-color: rgba(16, 185, 129, 0.4); color: var(--ok); }
.chip--err { border-color: rgba(239, 68, 68, 0.4); color: var(--err); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge--live { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.35); color: var(--live); }
.badge--ok { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35); color: var(--ok); }
.badge--err { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.35); color: var(--err); }

/* Trust Row */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--sys-hairline);
}
.trust-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--paper-muted); }
.trust-chip:first-child { color: var(--ok); }
.trust-chip:last-child { color: #C084FC; }

/* ── 3. Hold-to-Confirm Button ── */
.hold-btn {
  position: relative;
  width: 100%;
  height: 56px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #8B5CF6, #7C3AED);
  border: none;
  color: #FFF;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transition: transform 0.16s ease;
}
.hold-btn__ring { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.hold-btn__track { fill: none; stroke: rgba(255, 255, 255, 0.15); stroke-width: 4; }
.hold-btn__progress {
  fill: none;
  stroke: #FFF;
  stroke-width: 5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.1s linear;
}
.hold-btn--active .hold-btn__progress { animation: holdProgressRing var(--dur-hold, 1.2s) linear forwards; }
.hold-btn--emergency.hold-btn--active .hold-btn__progress { animation: holdProgressRing var(--dur-hold-emergency, 2s) linear forwards; }
@keyframes holdProgressRing {
  from { stroke-dashoffset: 283; }
  to   { stroke-dashoffset: 0; }
}
.hold-btn__content { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; }
.hold-btn--done { background: linear-gradient(135deg, #10B981, #059669); box-shadow: 0 0 24px rgba(16, 185, 129, 0.5); }

/* ── 4. Live Capsule (T1) ── */
.live-capsule-container {
  position: fixed;
  top: calc(var(--safe-top) + 62px);
  left: 16px;
  right: 16px;
  z-index: var(--z-topbar);
  pointer-events: none;
}
.live-capsule-container > * { pointer-events: auto; }
.live-capsule-hidden { display: none !important; }
.live-capsule-pill {
  width: 100%;
  max-width: 358px;
  margin: 0 auto;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--sys-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 4px 20px var(--sys-shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--sys-label);
}
.live-capsule-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hue, var(--hue-taxi));
  box-shadow: 0 0 8px var(--hue, var(--hue-taxi));
  flex-shrink: 0;
}
.live-capsule-icon { display: flex; align-items: center; color: var(--hue, var(--hue-taxi)); }
.live-capsule-label { font-size: 13px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-capsule-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #C084FC;
}

/* Expanded Capsule Stack */
.live-capsule-expanded {
  background: var(--sys-glass-strong);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 16px 48px var(--sys-shadow);
}
.live-capsule-expanded-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.live-capsule-stack { display: flex; flex-direction: column; gap: 10px; }
.live-capsule-card { background: var(--sys-raised-2); border: 1px solid var(--sys-hairline); border-radius: 18px; padding: 12px 14px; }
.live-capsule-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.live-capsule-service-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--hue, var(--hue-taxi));
}
.live-capsule-eta { font-size: 12px; font-weight: 800; color: var(--sys-label); }
.live-capsule-title { font-size: 14px; font-weight: 800; color: var(--sys-label); }
.live-capsule-sub { font-size: 11px; color: var(--paper-muted); margin-top: 2px; }
.live-capsule-track { width: 100%; height: 4px; border-radius: 99px; background: var(--sys-film-strong); margin-top: 8px; overflow: hidden; }
.live-capsule-progress { height: 100%; width: 50%; border-radius: 99px; background: linear-gradient(90deg, #8B5CF6, #C084FC); }

/* ── 5. Price Letter (T3) ── */
.price-letter-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.price-letter-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--sys-hairline); padding-bottom: 10px; }
.price-letter-category { display: flex; align-items: center; gap: 8px; }
.price-letter-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C084FC;
}
.price-letter-eyebrow { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--paper-muted); }
.price-letter-cat-name { display: block; font-size: 12px; font-weight: 700; color: #8B5CF6; }
.price-letter-hero { display: flex; justify-content: space-between; align-items: flex-end; }
.price-letter-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--sys-label); }
.price-letter-subtitle { font-size: 12px; color: var(--paper-muted); margin-top: 2px; }
.price-letter-total { text-align: end; }
.price-letter-amount { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--sys-label); line-height: 1; }
.price-letter-currency { font-size: 16px; font-weight: 600; color: var(--paper-muted); }
.price-letter-guarantee { display: block; font-size: 11px; font-weight: 600; color: var(--ok); }
.price-letter-breakdown {
  background: var(--sys-glass);
  border: 1px solid var(--sys-hairline);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.breakdown-labels { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; }
.breakdown-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; }
.breakdown-driver .breakdown-dot { background: #8B5CF6; }
.breakdown-platform .breakdown-dot { background: #6366F1; }
.breakdown-vat .breakdown-dot { background: #64748B; }
.breakdown-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; }
.breakdown-bar-segment { height: 100%; }
.segment-driver { width: 82%; background: #8B5CF6; }
.segment-platform { width: 12%; background: #6366F1; }
.segment-vat { width: 6%; background: #64748B; }

/* ── 6. State Views (Landmark Illustrations) ── */
.state-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  min-height: 280px;
}
.state-illustration-box {
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #A78BFA;
}
.glow-purple { filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.45)); }
.state-illustration--error { color: #EF4444; filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.45)); }
.state-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--sys-label); margin-bottom: 6px; }
.state-desc { font-size: 13px; color: var(--paper-muted); max-width: 280px; line-height: 1.45; margin-bottom: 20px; }
.btn-state-action { max-width: 240px; width: 100%; }

/* Skeletons */
.skeleton-bar--wide { width: 65%; }
.skeleton-bar--narrow { width: 40%; }
.skeleton-bar--full { width: 100%; }

/* ── 7. Toasts (R6) ── */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 60px);
  left: 20px;
  right: 20px;
  z-index: var(--z-toast);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  pointer-events: auto;
  max-width: 350px;
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--sys-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--sys-edge);
  box-shadow: 0 8px 30px var(--sys-shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sys-label);
  font-size: 13px;
  font-weight: 600;
}
.toast--exit { animation: toastDismiss 0.25s ease forwards; }
@keyframes toastDismiss {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}
.toast--ok { border-color: rgba(16, 185, 129, 0.4); }
.toast--ok .toast__icon { color: var(--ok); }
.toast--warn { border-color: rgba(245, 158, 11, 0.4); }
.toast--warn .toast__icon { color: var(--live); }
.toast--err { border-color: rgba(239, 68, 68, 0.4); }
.toast--err .toast__icon { color: var(--err); }

/* ── 8. Language Selector & Map Fallback ── */
.lang-selector-group {
  display: flex;
  align-items: center;
  background: var(--sys-film);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}
.btn-lang-tab {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--paper-muted);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-lang-tab.active { background: linear-gradient(135deg, var(--indigo), var(--purple)); color: #FFF; }

.map-fallback-canvas {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, rgba(99, 102, 241, 0.22) 0%, var(--sys-canvas) 75%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-fallback-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--sys-hairline) 1px, transparent 1px),
                    linear-gradient(90deg, var(--sys-hairline) 1px, transparent 1px);
  background-size: 36px 36px;
}
.map-fallback-content { position: relative; text-align: center; pointer-events: none; }
.map-fallback-icon-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 2px solid rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 0 30px rgba(128, 131, 255, 0.3);
  color: #C084FC;
}
.map-fallback-title { font-size: 15px; font-weight: 900; color: var(--sys-label); letter-spacing: 0.5px; }
.map-fallback-sub { font-size: 12px; color: rgba(192, 193, 255, 0.8); margin-top: 4px; font-weight: 700; }

/* ── 9. Stitch Full-Viewport Home View (Screen B1) ── */
.home-stitch-viewport {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 45;
  background: var(--sys-base);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
  align-items: center;
}

body.home-stitch-active .home-stitch-viewport {
  display: flex;
}

body.home-stitch-active [data-screen="B1"],
body.home-stitch-active [data-screen="B1"] > div {
  width: 100%;
  max-width: 390px;
  min-height: 844px;
}

@media (max-width: 480px) {
  body.home-stitch-active [data-screen="B1"],
  body.home-stitch-active [data-screen="B1"] > div {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100dvh !important;
  }
}

/* Hide legacy shell elements when full Stitch B1 Home is active */
body.home-stitch-active #map-container,
body.home-stitch-active #hemTopbar,
body.home-stitch-active #hemMapPinsOverlay,
body.home-stitch-active #fabLiveChat,
body.home-stitch-active #btnCenterGps,
body.home-stitch-active #bottom-sheet {
  display: none !important;
}

/* ── 10. Paper (html[data-apple-theme="light"], css/tokens.css): the pale accents drawn for obsidian, darkened to read ── */
html[data-apple-theme="light"] .trust-chip:last-child,
html[data-apple-theme="light"] .live-capsule-badge,
html[data-apple-theme="light"] .price-letter-icon,
html[data-apple-theme="light"] .map-fallback-icon-ring { color: var(--sys-accent-ink); }
html[data-apple-theme="light"] .state-illustration-box { color: var(--sys-accent); }
html[data-apple-theme="light"] .map-fallback-sub { color: var(--sys-label-2); }

/* ── 11. SeeYouSoon Club's background glows (O1–O8; the owner's iPhone, 2026-11-10: «a purple line in the background, some
   people take it for a fault») ──
   Each Club screen lights its background with one or two soft purple glows that its animation breathes. Two things drew them
   as a line or a band:
   - O1's second glow (.aurora-secondary, right of the tiles) has a gradient that reaches past the top of its own box, so the
     box cut it into a straight horizontal edge at 420 px across the right half of the screen (one pixel row from 8,10,15 to
     16,15,26 in dark, a pink step in light).
   - A glow's designed strength (12 % to 65 %) lived only in its animation's keyframes, its box at 100 %. With the phone's
     «Reduce motion» (or the app's calm mode) the frame stops every animation (css/frame.css), so the glow drew at full
     strength: on O2, O3 and O6 a bright purple band under the header that ends sharply at the header's frosted edge.
   Here each glow rests at its design's own first strength, so it is the same soft light with motion on or off; with motion on,
   the design's breathing runs as before. O1's second glow ends inside its box, with the reach into the screen the design gave
   it. O7 had a rule of its own already. tests/unit/layout/loading-look.test.mjs finds a Club glow drawn later without one. */
:is(#screen-outlet, #overlay-outlet) [data-screen="O1"] .aurora-bg { opacity: 0.42; }
:is(#screen-outlet, #overlay-outlet) [data-screen="O1"] .aurora-secondary {
  background: radial-gradient(ellipse 180px 115px at 85% 40%, rgba(183, 109, 255, 0.14) 0%, rgba(183, 109, 255, 0) 100%);
}
:is(#screen-outlet, #overlay-outlet) [data-screen="O2"] .aurora-bg { opacity: 0.12; }
:is(#screen-outlet, #overlay-outlet) [data-screen="O3"] .aurora-layer { opacity: 0.12; }
:is(#screen-outlet, #overlay-outlet) [data-screen="O4"] .aurora-bg { opacity: 0.16; }
:is(#screen-outlet, #overlay-outlet) [data-screen="O4"] .pulse-glow { opacity: 0.2; }
:is(#screen-outlet, #overlay-outlet) [data-screen="O5"] .aurora-bg { opacity: 0.85; }
:is(#screen-outlet, #overlay-outlet) [data-screen="O6"] .aurora-bg { opacity: 0.45; }
:is(#screen-outlet, #overlay-outlet) [data-screen="O6"] .aurora-secondary { opacity: 0.25; }
:is(#screen-outlet, #overlay-outlet) [data-screen="O8"] .aurora-pulse { opacity: 0.45; }
