/* ====== Apple Glass стили ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 12px 44px rgba(76, 29, 149, 0.22);
  --text-main: #1d1d1f;
  --text-muted: #6e6e73;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --offer-grad: linear-gradient(100deg, #f97316 0%, #ef4444 22%, #ec4899 45%, #8b5cf6 68%, #3b82f6 88%, #06b6d4 100%);
  --font-display: "Unbounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body { min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background:
    linear-gradient(135deg, #fff7ed 0%, #fef3c7 16%, #fce7f3 34%, #ede9fe 52%, #dbeafe 72%, #d1fae5 88%, #fef9c3 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 100px;
  position: relative;
  overflow-x: hidden;
}

/* Мягкие цветные "подсветки" по углам — как мазки краски на холсте */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 18%, rgba(249, 115, 22, 0.20), transparent 42%),
    radial-gradient(circle at 86% 22%, rgba(59, 130, 246, 0.20), transparent 44%),
    radial-gradient(circle at 78% 84%, rgba(236, 72, 153, 0.20), transparent 44%),
    radial-gradient(circle at 18% 82%, rgba(16, 185, 129, 0.18), transparent 42%);
}

/* Цветные "орбы" на фоне — как на apple.com */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(88px);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}
.orb-1 { width: 460px; height: 460px; background: #3b82f6; top: -140px; left: -100px; animation: orbFloat1 16s ease-in-out infinite alternate; }
.orb-2 { width: 420px; height: 420px; background: #ec4899; bottom: -120px; right: -80px; animation: orbFloat2 20s ease-in-out infinite alternate; }
.orb-3 { width: 340px; height: 340px; background: #f59e0b; top: 38%; left: 62%; animation: orbFloat3 24s ease-in-out infinite alternate; }
.orb-4 { width: 300px; height: 300px; background: #10b981; top: 10%; right: 6%; animation: orbFloat2 22s ease-in-out infinite alternate; }
.orb-5 { width: 320px; height: 320px; background: #8b5cf6; bottom: 6%; left: 4%; animation: orbFloat1 26s ease-in-out infinite alternate; }
.orb-6 { width: 260px; height: 260px; background: #f97316; top: 60%; left: -70px; animation: orbFloat3 18s ease-in-out infinite alternate; }

@keyframes orbFloat1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.15); }
}
@keyframes orbFloat2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-50px, -30px) scale(1.1); }
}
@keyframes orbFloat3 {
  from { transform: translate(0, 0) scale(1); opacity: 0.55; }
  to   { transform: translate(-40px, 50px) scale(1.2); opacity: 0.4; }
}

/* ====== Конфетти ====== */
.confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: -20px;
  left: var(--x, 50%);
  width: var(--w, 10px);
  height: var(--h, 14px);
  background: var(--c, #ec4899);
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall var(--dur, 9s) linear var(--delay, 0s) infinite;
}
@keyframes confettiFall {
  0%   { transform: translate3d(0, -12vh, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.95; }
  90%  { opacity: 0.95; }
  100% { transform: translate3d(var(--drift, 0px), 112vh, 0) rotate(720deg); opacity: 0; }
}

/* ====== Парящие emoji ====== */
.floaters {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.floaters span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: 34px;
  opacity: 0.55;
  filter: drop-shadow(0 6px 12px rgba(76, 29, 149, 0.18));
  animation: floaty var(--dur, 8s) ease-in-out var(--delay, 0s) infinite alternate;
}
@keyframes floaty {
  from { transform: translate(0, 0) rotate(-8deg) scale(1); }
  to   { transform: translate(16px, -26px) rotate(12deg) scale(1.12); }
}

/* Главная стеклянная карточка */
.glass-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--glass-shadow);
  padding: 40px 36px;
  animation: cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ====== Главное предложение ====== */
.offer { text-align: center; margin-bottom: 30px; }

.offer-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
  animation: fadeDown 0.6s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both, badgeGlow 3.2s ease-in-out infinite;
}

h1 {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.4;
  color: var(--text-main);
  animation: fadeDown 0.6s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}
h1 .offer-accent {
  background: var(--offer-grad);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradShift 7s ease-in-out infinite;
}
.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 10px;
  animation: fadeDown 0.6s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(124, 58, 237, 0); }
  50%      { box-shadow: 0 0 18px rgba(236, 72, 153, 0.45); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ====== Участники ====== */
.participant-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  animation: rowIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

input[type="text"], input[type="tel"], textarea, select {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  backdrop-filter: blur(8px);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
  background: rgba(255, 255, 255, 0.85);
}
input::placeholder, textarea::placeholder { color: #a1a1a6; }

.participant-row input[type="text"] { flex: 1; }

.ticket-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.ticket-toggle button {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.ticket-toggle button.active {
  background: #fff;
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.btn-remove {
  border: none;
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-remove:hover { background: rgba(255, 59, 48, 0.2); transform: scale(1.08); }
.btn-remove:disabled { opacity: 0.3; cursor: default; transform: none; }

/* ====== Кнопки ====== */
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed rgba(0, 113, 227, 0.4);
  background: rgba(0, 113, 227, 0.06);
  color: var(--accent);
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  margin-top: 4px;
}
.btn-add:hover { background: rgba(0, 113, 227, 0.12); transform: translateY(-1px); }
.btn-add:active { transform: translateY(0) scale(0.97); }

.btn-primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--offer-grad);
  background-size: 250% 100%;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: background-position 0.4s, transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.42);
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
}
.btn-primary:hover:not(:disabled) { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 8px 26px rgba(236, 72, 153, 0.5); }
.btn-primary:hover:not(:disabled)::after { left: 130%; }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.btn-primary:disabled { opacity: 0.55; cursor: default; box-shadow: none; }

/* ====== Секции формы ====== */
.field { margin-top: 20px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
textarea { resize: vertical; min-height: 76px; }

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

/* ====== Галочка мероприятия ====== */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}
.checkbox-label:hover { background: rgba(124, 58, 237, 0.1); }
.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 2px 5px 5px;
  accent-color: #7c3aed;
  cursor: pointer;
}
.event-price { color: #7c3aed; font-weight: 600; white-space: nowrap; }

/* ====== Промокод ====== */
.promo-row { display: flex; gap: 10px; }
.promo-row input { flex: 1; text-transform: uppercase; }
.btn-promo {
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-promo:hover:not(:disabled) { background: rgba(124, 58, 237, 0.18); }
.btn-promo:disabled { opacity: 0.5; cursor: default; }

.promo-applied {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.35);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #1f7a3d;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.promo-remove {
  border: none;
  background: transparent;
  color: #1f7a3d;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  opacity: 0.7;
}
.promo-remove:hover { opacity: 1; background: rgba(52, 199, 89, 0.15); }
.promo-error { margin-top: 8px; font-size: 13px; color: #d70015; }

/* ====== Итоговая цена ====== */
.total-box {
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
}
.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px 0;
}
.total-line.discount { color: #1f7a3d; font-weight: 500; }
.total-line.final {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-main);
  font-weight: 600;
}
.total-box .amount {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--offer-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}
.total-box .amount.pop { animation: amountPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes amountPop {
  0%   { transform: scale(0.85); opacity: 0.4; }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

.price-hint { font-size: 12px; color: var(--text-muted); margin-top: 10px; text-align: center; }

/* ====== Сообщения ====== */
.error-msg {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.25);
  color: #d70015;
  border-radius: 12px;
  font-size: 14px;
  animation: shakeIn 0.45s ease both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shakeIn {
  0%   { opacity: 0; transform: translateX(0); }
  20%  { opacity: 1; transform: translateX(-7px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

/* ====== Экран успеха ====== */
.success-wrap { text-align: center; padding: 20px 0; animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.success-icon {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34c759, #30b350);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 36px;
  box-shadow: 0 8px 24px rgba(52, 199, 89, 0.4);
  animation: successPop 0.55s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-wrap h2 { font-size: 22px; margin-bottom: 10px; animation: fadeUp 0.5s 0.25s both; }
.success-wrap p { color: var(--text-muted); font-size: 14px; line-height: 1.5; animation: fadeUp 0.5s 0.35s both; }
.success-icon.fail {
  background: linear-gradient(135deg, #ff6b5e, #ff3b30);
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.4);
}
.success-icon.pending {
  background: linear-gradient(135deg, #ffb84d, #ff9f0a);
  box-shadow: 0 8px 24px rgba(255, 159, 10, 0.4);
  font-size: 30px;
}
.spinner-box { display: flex; justify-content: center; margin-bottom: 20px; }
.spinner.big {
  width: 44px; height: 44px;
  border-width: 4px;
  border-color: rgba(124, 58, 237, 0.2);
  border-top-color: #7c3aed;
  margin-right: 0;
  vertical-align: baseline;
}
.success-details {
  margin: 22px 0;
  padding: 16px 20px;
  background: rgba(255,255,255,0.5);
  border-radius: 16px;
  text-align: left;
  font-size: 14px;
  line-height: 1.8;
  animation: fadeUp 0.5s 0.45s both;
}

@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== Страница оплаты (заглушка) ====== */
.pay-amount { font-size: 40px; font-weight: 700; text-align: center; letter-spacing: -1px; }
.pay-stub-note {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(255, 204, 0, 0.12);
  border: 1px solid rgba(255, 204, 0, 0.35);
  border-radius: 12px;
  font-size: 13px;
  color: #7a6200;
  text-align: center;
}
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -4px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== Футер ====== */
.footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  line-height: 1.7;
  animation: footerIn 0.8s 0.4s ease both;
}
@keyframes footerIn {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ====== Мобильная версия ====== */
@media (max-width: 560px) {
  body { padding: 24px 12px calc(110px + env(safe-area-inset-bottom, 0px)); }
  .glass-card { padding: 28px 18px; border-radius: 22px; }
  .offer { margin-bottom: 24px; }
  h1 { font-size: 21px; }
  .subtitle { font-size: 13px; }

  /* input ≥16px — iOS не зумит страницу при фокусе */
  input[type="text"], input[type="tel"], textarea, select { font-size: 16px; padding: 13px 14px; }

  .participant-row { gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
  .participant-row input[type="text"] { flex-basis: 100%; }
  .ticket-toggle { flex: 1; }
  .ticket-toggle button { flex: 1; padding: 10px 6px; }
  .btn-remove { width: 40px; height: 40px; min-width: 40px; }

  .checkbox-label { gap: 14px; padding: 14px; font-size: 13.5px; }
  .promo-row { flex-direction: column; }
  .btn-promo { padding: 14px; }

  .total-box { padding: 14px 16px; }
  .total-box .amount { font-size: 20px; }

  .btn-primary { padding: 16px; font-size: 15px; }
  .pay-amount { font-size: 32px; }
  .footer { font-size: 11.5px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); }

  /* Орбы меньше, чтобы не тормозить blur на слабых устройствах */
  .bg-orb { filter: blur(60px); }
  .orb-1 { width: 260px; height: 260px; }
  .orb-2 { width: 240px; height: 240px; }
  .orb-3 { width: 180px; height: 180px; }
  .orb-4 { width: 160px; height: 160px; }
  .orb-5 { width: 170px; height: 170px; }
  .orb-6 { width: 140px; height: 140px; }

  .floaters span { font-size: 24px; opacity: 0.4; }
}

/* Уважение к настройке «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
