:root {
  --blue: #2150fb;
  --blue-deep: #1236c7;
  --lime: #d6fd46;
  --graphite: #333333;
  --white: #ffffff;
  --bg: #f4f6fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-soft: #edf1ff;
  --text: #252525;
  --muted: #6c7180;
  --border: rgba(33, 80, 251, 0.12);
  --primary-text: #2150fb;
  --danger: #d33a4a;
  --shadow-sm: 0 8px 24px rgba(24, 40, 92, 0.08);
  --shadow-lg: 0 24px 64px rgba(22, 39, 90, 0.16);
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --content-width: 560px;
  --nav-height: 76px;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 5% 8%, rgba(33, 80, 251, 0.12), transparent 30%),
    radial-gradient(circle at 98% 42%, rgba(214, 253, 70, 0.18), transparent 24%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid rgba(33, 80, 251, 0.32); outline-offset: 3px; }
.hidden { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ambient { position: fixed; z-index: 0; border-radius: 999px; filter: blur(1px); pointer-events: none; }
.ambient-blue { width: 180px; height: 180px; left: -120px; top: 30%; background: rgba(33, 80, 251, 0.12); }
.ambient-lime { width: 150px; height: 150px; right: -100px; top: 8%; background: rgba(214, 253, 70, 0.3); }

.app-shell { position: relative; z-index: 1; width: min(100%, var(--content-width)); min-height: 100vh; margin: 0 auto; }
.app-header { display: flex; align-items: center; min-height: 80px; padding: calc(12px + env(safe-area-inset-top)) 20px 12px; }
.brand-lockup { display: flex; align-items: center; min-width: 0; }
.brand-lockup img { display: block; width: 156px; height: auto; }

.app-content { padding: 10px 20px calc(var(--nav-height) + 36px + env(safe-area-inset-bottom)); }
.screen { min-height: 560px; }
.eyebrow { margin: 0 0 6px; color: var(--primary-text); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 8vw, 38px); line-height: 1.08; letter-spacing: -0.045em; }
h2 { margin-bottom: 0; font-size: 22px; line-height: 1.18; letter-spacing: -0.035em; }

.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 8px 0 24px; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border: 2px solid rgba(33, 80, 251, 0.12); border-radius: 16px; color: var(--blue); background: var(--lime); font-size: 18px; font-weight: 800; box-shadow: var(--shadow-sm); transform: rotate(3deg); }

.boarding-card { position: relative; overflow: hidden; margin-bottom: 16px; border-radius: var(--radius-lg); color: var(--white); background: var(--blue); box-shadow: 0 24px 54px rgba(33, 80, 251, 0.28); }
.boarding-card::before { content: ""; position: absolute; width: 180px; height: 180px; right: -78px; top: -88px; border: 36px solid rgba(255,255,255,.08); border-radius: 50%; }
.boarding-card-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; min-height: 154px; padding: 26px 26px 22px; }
.card-kicker { display: block; margin-bottom: 8px; color: rgba(255,255,255,.76); font-size: 13px; font-weight: 600; }
.balance-line { display: flex; align-items: baseline; gap: 9px; }
.balance-line strong { font-size: 54px; line-height: 1; letter-spacing: -.06em; }
.balance-line span { font-size: 16px; font-weight: 600; }
.card-mark { position: relative; width: 60px; height: 60px; border: 4px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.ticket-divider { position: relative; height: 1px; margin: 0 18px; border-top: 1px dashed rgba(255,255,255,.34); }
.ticket-divider::before, .ticket-divider::after { content: ""; position: absolute; top: -12px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); }
.ticket-divider::before { left: -31px; }.ticket-divider::after { right: -31px; }
.boarding-card-bottom { display: grid; grid-template-columns: 1fr 1.1fr 44px; align-items: center; gap: 12px; padding: 20px 22px 22px; }
.boarding-card-bottom div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.boarding-card-bottom span { color: rgba(255,255,255,.65); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.boarding-card-bottom strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.card-action { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 15px; color: var(--graphite); background: var(--lime); cursor: pointer; transition: opacity .2s ease, box-shadow .2s ease; }
.card-action:active { opacity: .78; }.card-action svg { width: 20px; height: 20px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 30px; }
.stat-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); backdrop-filter: blur(16px); }
.stat-icon { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: var(--white); background: var(--blue); }
.stat-icon-lime { color: var(--graphite); background: var(--lime); }
.stat-icon svg { width: 20px; height: 20px; }
.stat-card div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.stat-card strong { font-size: 20px; letter-spacing: -.03em; }.stat-card span:last-child { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; }

.section { margin-bottom: 28px; }
.settings-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }.settings-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: var(--white); background: var(--blue); }.settings-icon svg { width: 20px; height: 20px; }.settings-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }.settings-copy strong { font-size: 14px; }.settings-copy span { color: var(--muted); font-size: 12px; }.text-button { min-height: 44px; padding: 0 4px; border: 0; color: var(--danger); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.security-note, .carryover-note { display: flex; align-items: flex-start; gap: 12px; padding: 4px 2px 10px; color: var(--muted); }.security-note > svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--primary-text); }.security-note p, .carryover-note p { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; line-height: 1.45; }.security-note strong, .carryover-note strong { color: var(--text); font-size: 13px; }

.plans-hero { margin: 8px 0 26px; }.plans-hero h1 { margin-bottom: 12px; }.plans-hero > p:last-child { max-width: 430px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.plans-list { display: grid; gap: 14px; }
.plan-card { position: relative; width: 100%; padding: 22px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); text-align: left; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease; backdrop-filter: blur(16px); }
.plan-card:active { opacity: .82; }.plan-card.featured { border: 2px solid var(--blue); box-shadow: 0 18px 46px rgba(33,80,251,.15); }.plan-card.current::after { content: "Текущий"; position: absolute; top: 18px; right: 18px; padding: 6px 9px; border-radius: 999px; color: var(--graphite); background: var(--lime); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.plan-badge { display: inline-flex; min-height: 26px; align-items: center; margin-bottom: 16px; padding: 0 9px; border-radius: 999px; color: var(--white); background: var(--blue); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }.plan-card:not(.featured) .plan-badge { color: var(--primary-text); background: var(--surface-soft); }
.plan-name { margin-bottom: 3px; font-size: 26px; font-weight: 800; letter-spacing: -.04em; }.plan-description { color: var(--muted); font-size: 13px; }.plan-metrics { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 22px; }.plan-price { display: flex; align-items: baseline; gap: 5px; }.plan-price strong { font-size: 32px; letter-spacing: -.05em; }.plan-price span { color: var(--muted); font-size: 12px; }.plan-unit { text-align: right; }.plan-unit strong { display: block; font-size: 14px; }.plan-unit span { color: var(--muted); font-size: 11px; }
.carryover-note { margin: 20px 0 10px; padding: 16px; border: 1px dashed rgba(33,80,251,.22); border-radius: var(--radius-sm); background: rgba(33,80,251,.04); }.carryover-icon { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: var(--graphite); background: var(--lime); }.carryover-icon svg { width: 18px; height: 18px; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 0; display: grid; width: min(100%, var(--content-width)); grid-template-columns: 1fr 1fr; padding: 8px 20px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(255,255,255,.86); box-shadow: 0 -14px 34px rgba(22,39,90,.08); transform: translateX(-50%); backdrop-filter: blur(22px); }
.nav-item { display: flex; min-height: 58px; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 18px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; transition: color .2s ease, background .2s ease; }.nav-item svg { width: 21px; height: 21px; }.nav-item.active { color: var(--blue); background: rgba(33,80,251,.08); }

.sheet-scrim { position: fixed; z-index: 30; inset: 0; background: rgba(18,22,34,.52); backdrop-filter: blur(3px); animation: fade-in .2s ease both; }
.checkout-sheet { position: fixed; z-index: 31; left: 50%; bottom: 0; width: min(100%, var(--content-width)); padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; color: var(--text); background: var(--surface-solid); box-shadow: 0 -24px 70px rgba(0,0,0,.2); transform: translateX(-50%); animation: sheet-in .3s cubic-bezier(.22,.8,.3,1) both; }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 20px; border-radius: 999px; background: var(--border); }.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }.icon-button { display: grid; flex: 0 0 auto; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 15px; color: var(--text); background: var(--surface-soft); cursor: pointer; }.icon-button svg { width: 20px; height: 20px; }
.order-summary { padding: 4px 18px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }.order-summary > div { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-bottom: 1px solid var(--border); }.order-summary > div:last-child { border-bottom: 0; }.order-summary span { color: var(--muted); font-size: 13px; }.order-summary strong { font-size: 14px; }.order-summary .order-total { min-height: 62px; }.order-summary .order-total span, .order-summary .order-total strong { color: var(--text); font-size: 18px; font-weight: 800; }
.button { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: center; gap: 12px; padding: 0 20px; border: 0; border-radius: 18px; font-weight: 800; cursor: pointer; transition: opacity .2s ease, box-shadow .2s ease; }.button:active { opacity: .8; }.button:disabled { cursor: not-allowed; opacity: .55; }.button-primary { color: var(--white); background: var(--blue); box-shadow: 0 14px 30px rgba(33,80,251,.22); }.button-lime { justify-content: space-between; color: var(--graphite); background: var(--lime); box-shadow: 0 14px 30px rgba(177,210,51,.22); }
.payment-caption { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 13px 0 0; color: var(--muted); font-size: 11px; }.payment-caption svg { width: 15px; height: 15px; }
.payment-field { display: grid; gap: 8px; margin-top: 16px; color: var(--text); font-size: 13px; font-weight: 700; }
.payment-field input { width: 100%; min-height: 48px; box-sizing: border-box; border: 1px solid rgba(33,80,251,.18); border-radius: 15px; padding: 0 15px; color: var(--text); background: var(--surface-soft); font: inherit; outline: none; }
.payment-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,80,251,.10); }
.renew-consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; margin: 14px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.renew-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); }

.state-view { display: flex; min-height: calc(100vh - 160px); align-items: center; justify-content: center; flex-direction: column; text-align: center; }.state-view h1 { max-width: 360px; margin-bottom: 12px; }.state-view > p:not(.eyebrow) { max-width: 360px; margin-bottom: 26px; color: var(--muted); font-size: 14px; line-height: 1.55; }.state-view .button { max-width: 320px; }
.state-illustration, .success-orbit { display: grid; place-items: center; width: 112px; height: 112px; margin-bottom: 24px; border-radius: 38px; color: var(--white); background: var(--blue); box-shadow: 0 20px 48px rgba(33,80,251,.24); transform: rotate(-4deg); }.state-icon { width: 42px; height: 42px; }.state-illustration-error { color: var(--graphite); background: var(--lime); }
.success-orbit { width: 130px; height: 130px; border: 1px solid rgba(33,80,251,.18); border-radius: 50%; background: rgba(33,80,251,.06); box-shadow: none; transform: none; }.success-mark { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 28px; color: var(--graphite); background: var(--lime); box-shadow: 0 18px 38px rgba(177,210,51,.24); transform: rotate(-4deg); }.success-mark svg { width: 36px; height: 36px; stroke-width: 2.5; }

.loading-view { padding-top: 16px; }.skeleton { min-height: 96px; border-radius: var(--radius-sm); background: linear-gradient(100deg, rgba(33,80,251,.05) 20%, rgba(33,80,251,.12) 40%, rgba(33,80,251,.05) 60%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }.skeleton-hero { min-height: 230px; border-radius: var(--radius-lg); }.skeleton-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 28px; }.skeleton-card { min-height: 130px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom)); width: min(calc(100% - 40px), 440px); padding: 14px 16px; border-radius: 16px; color: var(--white); text-align: center; background: var(--graphite); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; transform: translateX(-50%); animation: toast-in .24s ease both; }

.reveal { animation: reveal .38s cubic-bezier(.22,.8,.3,1) both; }.reveal-delay-1 { animation-delay: .05s; }.reveal-delay-2 { animation-delay: .1s; }.reveal-delay-3 { animation-delay: .15s; }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, 32px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (min-width: 700px) {
  .app-shell { margin-top: 24px; min-height: calc(100vh - 48px); border: 1px solid var(--border); border-radius: 38px; background: rgba(244,246,251,.82); box-shadow: var(--shadow-lg); overflow: hidden; }
  .bottom-nav { bottom: 24px; border: 1px solid var(--border); border-radius: 0 0 38px 38px; }
  .checkout-sheet { bottom: 24px; border-radius: 30px; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #191919; --surface: rgba(42,42,42,.94); --surface-solid: #272727; --surface-soft: #323232; --text: #ffffff; --muted: #b6b8c0; --border: rgba(255,255,255,.12); --primary-text: #d6fd46; --shadow-sm: 0 8px 24px rgba(0,0,0,.2); --shadow-lg: 0 24px 64px rgba(0,0,0,.34); }
  body { background: radial-gradient(circle at 5% 8%, rgba(33,80,251,.22), transparent 30%), radial-gradient(circle at 98% 42%, rgba(214,253,70,.12), transparent 24%), var(--bg); }
  .brand-lockup { padding: 7px 10px; border-radius: 12px; background: var(--white); }
  .ticket-divider::before, .ticket-divider::after { background: #191919; }
  .bottom-nav { background: rgba(31,31,31,.9); }.nav-item.active { color: var(--lime); background: rgba(214,253,70,.1); }
  .plan-card:not(.featured) .plan-badge { color: var(--lime); }.carryover-note { background: rgba(214,253,70,.05); }
  .app-shell { background: rgba(25,25,25,.84); }
}

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