/* =========================================================================
   /start — воронка-калькулятор. Дизайн-система главной страницы (Award Edition).
   ========================================================================= */

:root {
  color-scheme: dark;

  --bg: #08070a;
  --ink: #f7f2e9;
  --muted: #b6ac9c;

  --gold: #f4c64d;
  --gold-soft: #ffe1a0;
  --green: #3ce8a4;

  --line: rgba(247, 242, 233, 0.12);
  --line-strong: rgba(247, 242, 233, 0.22);
  --glass: rgba(255, 250, 240, 0.045);
  --glass-2: rgba(255, 250, 240, 0.08);

  --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.42);

  --radius: 18px;
  --radius-lg: 26px;

  --font-body: "Manrope", "Segoe UI", system-ui, Arial, sans-serif;
  --font-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
}

a[x-apple-data-detectors],
a[x-apple-data-detectors]:hover,
a[x-apple-data-detectors]:active,
a[x-apple-data-detectors]:focus,
a[href^="tel"],
a[href^="sms"] {
  color: inherit !important;
  text-decoration: none !important;
  font: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
}

/* Атмосферный фон */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.aurora {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
}
.aurora--gold { background: var(--gold); top: -25vmax; right: -20vmax; }
.aurora--green { background: var(--green); bottom: -30vmax; left: -22vmax; opacity: 0.10; }

.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 32px) 60px;
}

/* Шапка */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(150deg, rgba(244, 198, 77, 0.18), rgba(60, 232, 164, 0.12));
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}
.brand__mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand__mark-bar { stroke: var(--green); }
.brand__name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--muted);
}
.brand__name b { color: var(--ink); }
.back-btn {
  border: 1px solid var(--line-strong);
  background: var(--glass);
  color: var(--muted);
  font: 600 13px/1 var(--font-body);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.back-btn:hover { color: var(--ink); border-color: var(--gold); }

/* Экраны */
.screen {
  display: none;
  animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.screen.is-active { display: block; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Типографика */
.title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 6vw, 40px);
  line-height: 1.15;
  margin: 8px 0 18px;
}
.title--sm { font-size: clamp(21px, 5vw, 30px); font-weight: 800; }
.accent { color: var(--gold); }
.lead { font-weight: 700; color: var(--ink); }
.hint { color: var(--muted); font-size: 14px; margin: -6px 0 14px; }
.mark {
  color: var(--gold);
  font-weight: 800;
}
.mark-red {
  color: #ff4d3d;
  font-weight: 900;
}
u {
  text-decoration-color: rgba(244, 198, 77, 0.9);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: auto;
}

.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 4vw, 26px);
  margin: 0 0 22px;
  box-shadow: var(--shadow-card);
}
.panel p { margin: 0 0 12px; }
.panel p:last-child { margin-bottom: 0; }
.cashback-question {
  margin: 20px 0 10px;
  padding: 12px 15px 12px 17px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(18px, 4.2vw, 22px);
  font-weight: 800;
  line-height: 1.25;
  border: 1px solid rgba(244, 198, 77, 0.26);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(244, 198, 77, 0.07);
}
.cashback-question--final {
  margin-top: 20px;
  border-color: rgba(244, 198, 77, 0.45);
  background: rgba(244, 198, 77, 0.11);
  box-shadow: 0 12px 32px rgba(244, 198, 77, 0.12);
}
.inline-frame {
  padding: 14px 16px;
  border: 1px solid rgba(244, 198, 77, 0.42);
  border-radius: var(--radius);
  background: rgba(244, 198, 77, 0.08);
  color: var(--ink);
  font-weight: 700;
}
.inline-arrow {
  display: inline-block;
  position: relative;
  width: 22px;
  height: 30px;
  margin-left: 6px;
  color: var(--gold);
  vertical-align: -4px;
  filter: drop-shadow(0 10px 18px rgba(244, 198, 77, 0.45));
  animation: arrow-bounce 1s ease-in-out infinite;
}
.inline-arrow::before,
.inline-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  display: block;
}
.inline-arrow::before {
  top: 2px;
  width: 4px;
  height: 22px;
  background: currentColor;
  border-radius: 999px;
  transform: translateX(-50%);
}
.inline-arrow::after {
  bottom: 2px;
  width: 13px;
  height: 13px;
  border-right: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
}
@keyframes arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.text-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding-left: 20px;
}
.text-list li { padding-left: 2px; }
.text-list li::marker {
  color: var(--gold);
  font-weight: 900;
}
.proof-box {
  margin: 20px 0 16px;
  padding: 16px 18px;
  border: 1px solid rgba(244, 198, 77, 0.42);
  border-radius: var(--radius);
  background: rgba(244, 198, 77, 0.08);
}
.proof-box h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font: 800 clamp(17px, 4.2vw, 21px)/1.3 var(--font-display);
}
.proof-box p { margin-bottom: 0; }

/* Кнопки */
.btn {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 15px 22px;
  border-radius: 999px;
  border: 0;
  font: 800 16px/1.25 var(--font-body);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.btn:disabled {
  cursor: wait;
  opacity: 0.94;
}
.btn:active { transform: scale(0.98); }
.btn--gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #241a05;
  box-shadow: 0 12px 34px rgba(244, 198, 77, 0.28);
}
.btn--gold:hover { box-shadow: 0 14px 40px rgba(244, 198, 77, 0.4); }
.btn--ghost {
  background: var(--glass);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover { border-color: var(--gold); }
.btn-row { display: grid; gap: 12px; }
.btn.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.calc-pulse {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(36, 26, 5, 0.22);
  border-top-color: #241a05;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.calc-text { white-space: normal; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Экран расчёта */
.calc-screen {
  display: grid;
  justify-items: center;
  gap: 22px;
  background: radial-gradient(circle at 50% 0, rgba(244, 198, 77, 0.16), var(--glass) 46%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 7vw, 42px);
  box-shadow: var(--shadow-card);
}
.calc-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 138px;
  height: 138px;
}
.calc-ring span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--gold), var(--green), var(--gold));
  animation: spin 1.1s linear infinite;
}
.calc-ring span::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: #111014;
  border: 1px solid var(--line);
}
.calc-ring b {
  position: relative;
  z-index: 1;
  font: 900 46px/1 var(--font-display);
  color: var(--gold);
}
.calc-steps {
  width: 100%;
  display: grid;
  gap: 10px;
}
.calc-step {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--glass);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.calc-step.is-active {
  color: var(--ink);
  border-color: rgba(244, 198, 77, 0.45);
  background: rgba(244, 198, 77, 0.1);
}
.calc-step.is-done {
  color: var(--green);
  border-color: rgba(60, 232, 164, 0.38);
  background: rgba(60, 232, 164, 0.07);
}

/* Плитки банков */
.banks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}
.bank {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 10px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.bank__badge {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--glass-2);
  border: 1px solid var(--line);
  font: 900 11px/1 var(--font-display);
  color: #fff;
  letter-spacing: 0;
  text-transform: uppercase;
}
.bank__logo {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: contain;
  border-radius: 50%;
  z-index: 1;
  opacity: 0;
}
.bank__badge-text {
  position: relative;
  z-index: 0;
}
.bank__badge.has-logo .bank__logo { opacity: 1; }
.bank__badge.has-logo .bank__badge-text { opacity: 0; }
.bank__badge--alfa { background: #ef3124; }
.bank__badge--tbank { background: #ffd429; color: #181818; }
.bank__badge--uralsib { background: #32104f; }
.bank__badge--otp { background: #c7ff00; color: #182000; font-size: 9px; }
.bank__badge--vtb { background: #0a6ee8; font-size: 9px; }
.bank__badge--credit-europe { background: #1a4f9b; font-size: 10px; }
.bank__badge--yandex { background: #f6f6f6; color: #202020; }
.bank__badge--sovcom { background: linear-gradient(135deg, #e5374e 0 50%, #1f9bd1 50%); }
.bank__badge--ubrir { background: #d7194a; font-size: 10px; }
.bank__badge--mts { background: #fff; color: #e30613; font-size: 9px; }
.bank__badge--psb { background: #26358c; font-size: 9px; }
.bank__badge--rshb { background: #0b7f3a; font-size: 8px; }
.bank__badge--ozon { background: #005bff; font-size: 10px; }
.bank__badge--default { background: var(--glass-2); color: var(--muted); }
.bank__name {
  min-width: 0;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.bank--long .bank__name { font-size: 12.5px; }
.bank input { display: none; }
.bank.is-on {
  border-color: var(--green);
  background: rgba(60, 232, 164, 0.08);
}
.bank.is-on .bank__badge {
  background: var(--green);
  border-color: var(--green);
  color: #06231a;
}
.bank.is-on .bank__logo { opacity: 1; }

/* Результат */
.result-label {
  color: var(--muted);
  font-size: 15px;
  text-align: center;
  margin: 26px 0 4px;
}
.result-sum {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 10vw, 64px);
  color: var(--gold);
  text-align: center;
  margin: 0 0 24px;
  text-shadow: 0 10px 44px rgba(244, 198, 77, 0.35);
}

/* Квалификация */
.qual-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 18px;
}
.qual-photo {
  width: 132px;
  height: 132px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid var(--gold);
}
.qual-name { font: 800 18px/1.2 var(--font-display); margin: 0; }
.qual-role { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.q-step {
  display: inline-block;
  font: 700 12px/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(244, 198, 77, 0.1);
  border: 1px solid rgba(244, 198, 77, 0.35);
  border-radius: 999px;
  padding: 7px 14px;
  margin: 0 0 14px;
}

/* Видео */
.video-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  margin: 0 0 20px;
}
.video-slot iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Вертикальное видео 9:16 (подводка альфийцам) */
.video-slot--vertical {
  aspect-ratio: 9 / 16;
  max-width: 390px;
  margin: 0 auto 20px;
}
.alpha-player {
  position: relative;
  max-width: 390px;
  margin: 82px auto 20px;
}
.alpha-cue {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 10px 20px;
  color: #07060a;
  background: linear-gradient(95deg, var(--gold), var(--green) 130%);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(244, 198, 77, 0.28);
  cursor: pointer;
  font: 800 13px/1.2 var(--font-body);
  white-space: nowrap;
  transform: translateX(-50%);
}
.alpha-cue__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--gold);
  background: #07060a;
  border-radius: 50%;
  font-size: 11px;
}
.alpha-player.is-playing .alpha-cue {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.alpha-volume {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(100%, 260px);
  padding: 9px 13px;
  color: var(--ink);
  background: rgba(8, 7, 10, 0.76);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s ease;
  backdrop-filter: blur(14px);
  font: 800 12px/1.2 var(--font-body);
}
.alpha-player.is-playing .alpha-volume {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}
.alpha-volume__label { color: var(--muted); }
.alpha-volume__range {
  width: 100%;
  height: 4px;
  margin: 0;
  accent-color: var(--green);
}
.alpha-volume__value {
  min-width: 34px;
  color: var(--green);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.between-videos { color: var(--muted); margin: 4px 0 12px; }
.presentation-link { margin-top: 4px; }
.presentation-callout {
  color: var(--ink);
  font-weight: 800;
  padding: 14px 16px;
  border: 1px solid rgba(244, 198, 77, 0.38);
  border-radius: var(--radius);
  background: rgba(244, 198, 77, 0.1);
}
.presentation-callout span {
  color: var(--gold);
}

/* Мессенджеры */
.messenger-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.messenger-btn {
  position: relative;
  min-height: 56px;
  max-height: 56px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  font: 800 14px/1.1 var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.messenger-icon {
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  max-width: 24px;
  min-height: 24px;
  max-height: 24px;
  overflow: hidden;
  padding: 0;
  font: 900 10px/1 var(--font-display);
  line-height: 0;
}
.messenger-btn .messenger-icon img {
  display: block;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  object-fit: contain;
  flex: 0 0 24px;
}
.messenger-btn--tg { background: #2aabee; }
.messenger-btn--vk { background: #0077ff; }
.messenger-btn--max {
  background: #fff;
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.18);
}

.foot {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
}

@media (max-width: 420px) {
  .banks { grid-template-columns: 1fr 1fr; }
  .bank { gap: 8px; padding: 8px; }
  .bank__badge {
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
  }
  .bank__name { font-size: 12.5px; }
  .bank--long .bank__name { font-size: 11.5px; }
  .messenger-grid { grid-template-columns: 1fr; }
}

/* Длинные тексты финалов: подзаголовки-крючки и выделения */
.panel .sub {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(17px, 4.2vw, 21px);
  line-height: 1.3;
  margin: 26px 0 14px;
  padding: 13px 16px 13px 18px;
  color: var(--ink);
  border: 1px solid rgba(244, 198, 77, 0.26);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(244, 198, 77, 0.07);
}
.panel .sub:first-child,
.panel div > .sub:first-child {
  margin-top: 0;
}
/* Плавное появление абзацев при скролле (длинные финалы) */
.fx-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fx-reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .fx-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Telegram Desktop WebApp: окно уже обычного браузера, но устройство десктопное.
   Убираем viewport-раздувание и делаем калькулятор плотнее без влияния на мобильный Telegram. */
.tg-webapp-desktop body {
  font-size: 14px;
  line-height: 1.45;
}
.tg-webapp-desktop .shell {
  max-width: 980px;
  padding: 12px 18px 34px;
}
.tg-webapp-desktop .topbar {
  padding: 4px 0 14px;
}
.tg-webapp-desktop .brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.tg-webapp-desktop .brand__mark svg {
  width: 19px;
  height: 19px;
}
.tg-webapp-desktop .brand__name {
  font-size: 10.5px;
}
.tg-webapp-desktop .back-btn {
  padding: 8px 12px;
  font-size: 12px;
}
.tg-webapp-desktop .title {
  font-size: 28px;
  line-height: 1.12;
  margin: 6px 0 12px;
}
.tg-webapp-desktop .title--sm {
  font-size: 23px;
}
.tg-webapp-desktop .panel {
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.tg-webapp-desktop .panel p {
  margin-bottom: 9px;
}
.tg-webapp-desktop .hint,
.tg-webapp-desktop .bank__name,
.tg-webapp-desktop .result-label,
.tg-webapp-desktop .qual-role {
  font-size: 12.5px;
}
.tg-webapp-desktop .cashback-question,
.tg-webapp-desktop .panel .sub {
  font-size: 17px;
  padding: 10px 12px;
  border-radius: 14px;
}
.tg-webapp-desktop .inline-frame,
.tg-webapp-desktop .proof-box {
  padding: 12px 14px;
  border-radius: 14px;
}
.tg-webapp-desktop .btn {
  min-height: 0;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 14px;
}
.tg-webapp-desktop .btn-row {
  gap: 9px;
}
.tg-webapp-desktop .banks {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}
.tg-webapp-desktop .bank {
  min-height: 74px;
  padding: 10px 8px;
  border-radius: 13px;
}
.tg-webapp-desktop .bank__badge {
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
}
.tg-webapp-desktop .result-sum {
  font-size: 44px;
  margin: 4px 0 12px;
}
.tg-webapp-desktop .calc-screen {
  padding: 18px;
  border-radius: 16px;
}
.tg-webapp-desktop .calc-step {
  font-size: 14px;
}
.tg-webapp-desktop .foot {
  margin-top: 20px;
  font-size: 12px;
}
