/* SOS Flights v2 — built on the HotelHops Premium prototype system (config → CSS vars → Tailwind names).
   Brand values arrive as CSS variables from config/sos.js (applyBrand in shared.js). */
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.disp { font-family: var(--disp); letter-spacing: -.02em; }
.mono { font-family: var(--mono); }
.tabular { font-variant-numeric: tabular-nums; }

/* Glass card: blurred translucent fill + hairline edge brighter at the top (masked gradient on ::before). */
.card { border-radius: 16px; }
.card, .glass { position: relative; background: var(--surface); border: 1px solid var(--border); }
.notif { position: relative; background: rgba(36,38,44,.86); border: 1px solid rgba(255,255,255,.07); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 14px 32px -14px rgba(0,0,0,.7); }
.card.hot { border-color: color-mix(in srgb, var(--primary) 55%, transparent); }

/* Chips. Colour law (spec v1.2 §8): green = artifact in hand · amber = waiting · beacon = act now · red = broken. */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip-ok { background: var(--okTint); color: var(--ok); }
.chip-act { background: var(--primaryTint); color: var(--primary); }
.chip-info { background: var(--infoTint); color: var(--info); }
.chip-warn { background: var(--warnTint); color: var(--warn); }
.chip-bad { background: var(--badTint); color: var(--bad); }
.chip-neutral { background: var(--surface2); color: var(--muted); }
.cert { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; border: 1px solid currentColor; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 20px; border-radius: 14px; font-weight: 600; font-size: 16px; transition: transform .15s ease, background-color .2s ease, opacity .2s, box-shadow .25s; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--onPrimary); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--primary) 70%, transparent); }
@media (hover: hover) { .btn-primary:hover { background: var(--primaryHover); } }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-apple { background: #000; color: #fff; border: 1px solid #222; }
.btn-ghost { background: transparent; color: var(--muted); min-height: 44px; font-weight: 500; }
@media (hover: hover) { .btn-ghost:hover { color: var(--text); } }
.btn-pill { border-radius: 999px; }

.notif { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 18px; text-align: left; }

.badge { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px; border-radius: 12px; background: #000; border: 1px solid #a6a6a6; color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.04), 0 10px 28px -10px color-mix(in srgb, var(--primary) 40%, transparent); transition: transform .15s, box-shadow .2s; }
.badge:hover { transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(255,255,255,.08), 0 14px 32px -10px color-mix(in srgb, var(--primary) 55%, transparent); }
.badge span { display: flex; flex-direction: column; line-height: 1.05; font-size: 18px; font-weight: 500; }
.badge small { font-size: 12px; font-weight: 400; opacity: .85; }

/* Web look: flat dark with a fine grid and one soft orange glow (no stars). */
.sky { background: radial-gradient(90% 45% at 50% 0%, rgba(255,136,0,.10), transparent 70%), linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 40px 40px, var(--bg); }
.star { position: absolute; border-radius: 50%; background: #fff; opacity: .2; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .12; transform: scale(.8); } 50% { opacity: .85; transform: scale(1.1); } }
.glow { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }

/* ---------- SOS signature 1: split-flap departures board ---------- */
.fids { font-family: var(--mono); background: #07080d; border-radius: 14px; padding: 10px; overflow: hidden; container-type: inline-size; box-shadow: inset 0 0 0 1px #1b1f2c, 0 20px 50px -20px rgba(0,0,0,.8); }
.fids-head, .fids-row { display: grid; grid-template-columns: auto auto 1fr auto; column-gap: 10px; align-items: center; padding: 3px 4px; }
.fids-head { font-size: 12px; letter-spacing: .06em; color: #f5b83d; padding-bottom: 6px; text-transform: uppercase; }
.fids-head > span, .fids-row > span { min-width: 0; }
.fids-row { border-radius: 6px; transition: background .4s; }
@container (max-width: 330px) { .fids-head > :first-child, .fids-row > :first-child { display: none; } .fids-head, .fids-row { grid-template-columns: auto 1fr auto; } }
.fids-head > *, .fids-row > * { justify-self: start; }
.fids-row.hit { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.flaps { display: inline-flex; gap: 1.5px; }
.flap { display: inline-grid; place-items: center; width: .82em; height: 1.32em; font-size: 12px; font-weight: 600; color: #e9ecf2; background: linear-gradient(#1a1d27 0 49%, #0b0d13 49% 51%, #161922 51%); border-radius: 2px; transform-origin: 50% 50%; }
.flap.f { animation: flip .09s linear; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(80deg); filter: brightness(.6); } 100% { transform: rotateX(0); } }
.fids .st-bad .flap { color: var(--bad); }
.fids .st-ok .flap { color: var(--ok); }
.fids .st-warn .flap { color: var(--warn); }

/* ---------- SOS signature 2: runway approach lights ("rabbit") ---------- */
.rabbit { display: flex; gap: var(--gap, 14px); justify-content: center; }
.rabbit i { width: var(--s, 5px); height: var(--s, 5px); border-radius: 50%; background: #fff3d6; opacity: .14; animation: rabbit 1.6s linear infinite; box-shadow: 0 0 10px 2px rgba(255,236,190,.0); }
@keyframes rabbit { 0%, 8% { opacity: 1; box-shadow: 0 0 12px 3px rgba(255,236,190,.75); } 18%, 100% { opacity: .14; box-shadow: 0 0 0 0 transparent; } }

/* ---------- SOS signature 3: beacon pulse ---------- */
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc, var(--primary)) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--primary)); animation: pulseRing 1.6s ease-out infinite; flex-shrink: 0; }
.live-dot.ok { --pc: var(--ok); } .live-dot.warn { --pc: var(--warn); } .live-dot.bad { --pc: var(--bad); }
.sos-btn { position: relative; border-radius: 999px; }
.sos-btn::after { content: ''; position: absolute; inset: -6px; border-radius: inherit; border: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); animation: ring 2.2s cubic-bezier(.22,1,.36,1) infinite; }
@keyframes ring { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }

/* Motion utilities (her vocabulary; tokens from premium-ui-motion). */
.rise { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.22,1,.36,1); }
.rise.in { opacity: 1; transform: none; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.float { animation: floatY 5s ease-in-out infinite; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
.pop { animation: pop .45s cubic-bezier(.34,1.36,.64,1) both; }
@keyframes slideDown { from { transform: translateY(-24px) scale(.96); opacity: 0; filter: blur(2px); } to { transform: none; opacity: 1; filter: none; } }
.slide-down { animation: slideDown .55s cubic-bezier(.22,1,.36,1) both; }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.slide-up { animation: slideUp .5s cubic-bezier(.22,1,.36,1) both; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1.2s linear infinite; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
.shake { animation: shake .4s ease both; }
@keyframes shimmer { to { background-position: -200% 0; } }
.shimmer { background: linear-gradient(90deg, var(--muted) 0%, #fff 50%, var(--muted) 100%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
.strike { position: relative; }
.strike::after { content: ''; position: absolute; left: -2px; right: -2px; top: 52%; height: 2px; background: var(--bad); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.22,1,.36,1); }
.strike.on::after { transform: scaleX(1); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 100; background: #0b0d16; border: 1px solid var(--border); color: var(--text); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100vw - 32px); transition: all .3s cubic-bezier(.22,1,.36,1); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

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

/* ---------- Theme "vlado": the look of v2 (glass cards, night sky). Colours come from boot.js. ---------- */
.theme-vlado .card, .theme-vlado .notif, .theme-vlado .glass { background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.015)), color-mix(in srgb, var(--surface) 62%, transparent); border: 1px solid transparent; backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 32px -16px rgba(0,0,0,.7); }
.theme-vlado .card::before, .theme-vlado .notif::before, .theme-vlado .glass::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(165deg, rgba(255,255,255,.32), rgba(255,255,255,.08) 35%, rgba(255,255,255,.03) 65%, rgba(255,255,255,.12)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.theme-vlado .card.hot::before { background: linear-gradient(165deg, color-mix(in srgb, var(--primary) 80%, transparent), rgba(255,255,255,.06) 40%, rgba(255,255,255,.03) 70%, color-mix(in srgb, var(--primary) 30%, transparent)); }
.theme-vlado .sky, .theme-vlado body.sky { background: radial-gradient(120% 60% at 50% 115%, color-mix(in srgb, var(--primary) 22%, transparent) 0%, transparent 55%), radial-gradient(120% 70% at 20% 0%, #15203d 0%, #0a1024 38%, var(--bg) 78%); }
