:root {
  --bg: #0b0b10;
  --surface: #15151d;
  --surface-2: #1e1e29;
  --line: #2a2a38;
  --text: #f4f4f6;
  --muted: #9a9aab;
  --accent: #d4ff3a;
  --accent-ink: #0b0b10;
  --danger: #ff5c7a;
  --radius: 18px;
  --display: 'Syne Variable', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 'Inter Variable', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.has-buybar { padding-bottom: 96px; }
a { color: inherit; }
h1, h2 { margin: 0; line-height: 1.1; }
button { font: inherit; cursor: pointer; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; flex: 1; }
.container.narrow { max-width: 620px; }
.muted { color: var(--muted); margin: 4px 0 0; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; grid-column: 1 / -1; }

/* Cabecera */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; width: 100%; margin: 0 auto; padding: 20px;
}
.logo { font-family: var(--display); font-weight: 800; font-size: 26px; text-decoration: none; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.back { color: var(--muted); text-decoration: none; font-weight: 500; }
.back:hover { color: var(--text); }

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  min-height: clamp(360px, 42vw, 520px);
  margin: 0 -20px 32px; padding: 52px clamp(24px, 6vw, 84px) 78px;
  animation: pageEntrance .85s cubic-bezier(.2,.75,.25,1) both;
}
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background:
    linear-gradient(90deg, rgba(11,11,16,.86) 0%, rgba(11,11,16,.55) 42%, rgba(11,11,16,.16) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(11,11,16,.22) 24%, transparent 58%),
    url('/images/banner-principal.jpeg') center 48% / cover no-repeat;
  mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
}
.hero h1 { max-width: 650px; font-family: var(--display); font-size: clamp(38px, 7vw, 68px); letter-spacing: -1.5px; text-shadow: 0 3px 24px rgba(0,0,0,.4); }
.hero p { color: #e1e1e9; font-size: 18px; margin: 14px 0 0; text-shadow: 0 2px 16px rgba(0,0,0,.65); }
.psychedelic-word {
  display: inline-block;
  background: linear-gradient(105deg, #ff75dd 0%, #ffc879 22%, #f7ff9b 38%, #7cf5ee 57%, #9fa8ff 76%, #ff75dd 100%);
  background-size: 260% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(222, 112, 255, .5));
  animation: iridescentFlow 6s ease-in-out infinite, iridescentGlow 3s ease-in-out infinite;
}
@keyframes iridescentFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes iridescentGlow {
  0%, 100% { filter: drop-shadow(0 0 7px rgba(222, 112, 255, .38)); }
  50% { filter: drop-shadow(0 0 15px rgba(89, 231, 255, .62)); }
}
@media (prefers-reduced-motion: reduce) {
  .psychedelic-word { animation: none; background-position: 50% 50%; }
}

/* Listado de eventos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-bottom: 48px; }
.card {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s ease, border-color .15s ease;
  animation: pageEntrance .7s cubic-bezier(.2,.75,.25,1) both;
}
.grid > .card:nth-child(2) { animation-delay: .12s; }
.grid > .card:nth-child(3) { animation-delay: .22s; }
@keyframes pageEntrance {
  from { opacity: 0; transform: translateY(22px); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero, .grid > .card { animation: none; }
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card.is-sold { opacity: .6; }
.card.skeleton { height: 340px; background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%) 0 0 / 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

.cover { aspect-ratio: 16 / 9; display: flex; align-items: flex-end; padding: 16px; }
.cover-title {
  font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1;
  color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.35); letter-spacing: -0.5px;
}
.card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.card-body h2 { font-size: 20px; }
.date { color: var(--accent); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 6px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 18px; }
.recurring-fee { color: var(--accent); font-size: 12px; margin: 10px 0 0; }
.from { color: var(--muted); font-size: 14px; }
.from strong { color: var(--text); font-size: 18px; }
.cta { font-weight: 700; color: var(--accent); }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .5px; }
.tag.sold { background: rgba(255, 92, 122, .15); color: var(--danger); }
.tag.low { background: rgba(255, 184, 0, .15); color: #ffb800; font-size: 11px; padding: 2px 8px; vertical-align: 2px; margin-left: 6px; }

/* Ficha del evento */
.event-cover { aspect-ratio: 16 / 8; border-radius: var(--radius); display: flex; align-items: flex-end; padding: 22px; margin: 8px 0 24px; }
.event-cover .cover-title { font-size: clamp(30px, 7vw, 44px); }
.event-title { font-family: var(--display); font-size: clamp(30px, 6vw, 40px); letter-spacing: -1px; }
.event-desc { color: #cfcfdb; margin: 16px 0 0; white-space: pre-line; }
.section-title { font-size: 18px; margin: 32px 0 12px; }

.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticket {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
}
.ticket.is-sold { opacity: .55; }
.ticket strong { display: block; font-size: 17px; }
.ticket small { display: block; color: var(--muted); }
.price { display: block; font-weight: 700; margin-top: 6px; }
.subscription-callout { margin: 20px 0; padding: 16px 18px; border: 1px solid rgba(212,255,58,.3); border-radius: 14px; background: rgba(212,255,58,.06); }
.subscription-callout strong { display:block; font-size:15px; }
.subscription-callout p { margin:5px 0 0; color:var(--muted); font-size:13px; line-height:1.55; }

.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 99px; padding: 4px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: var(--line); color: var(--text); font-size: 20px; line-height: 1;
}
.stepper button[data-step="1"] { background: var(--accent); color: var(--accent-ink); }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; }

/* Barra de compra fija */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  max-width: 620px; margin: 0 auto; padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  background: rgba(21, 21, 29, .92); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0;
}
.buybar small { display: block; color: var(--muted); }
.buybar strong { font-size: 22px; }
.buybar #buy-monthly { color: var(--accent); font-size: 11px; margin-top: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 99px; padding: 14px 28px; font-weight: 700; text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.wide { width: 100%; margin-top: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: var(--danger); color: #fff; font-weight: 600; margin: 0;
  padding: 10px 18px; border-radius: 99px; max-width: calc(100% - 32px); text-align: center;
}

/* Pago y confirmación */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin: 12px 0 48px; }
.panel-title { font-family: var(--display); font-size: 32px; letter-spacing: -0.5px; }
.summary { list-style: none; padding: 0; margin: 24px 0 8px; border-top: 1px solid var(--line); }
.summary li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-total { font-weight: 800; font-size: 20px; border-bottom: 0 !important; }
.summary-note { color: var(--muted); font-size: 12px; border-bottom: 0 !important; padding-top: 0 !important; }
.summary-note span:last-child { max-width: 68%; text-align: right; overflow-wrap: anywhere; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 32px; font-weight: 800; margin-bottom: 18px;
}
.order-code { margin: 18px 0 0; color: var(--muted); }
.order-code strong { color: var(--text); font-family: ui-monospace, monospace; letter-spacing: 1px; }

/* Pasarela de pago */
.secure-badge { color: var(--muted); font-size: 14px; font-weight: 500; }
.checkout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px;
  align-items: start; max-width: 980px; padding-bottom: 48px;
}
.checkout > .empty, .checkout > .panel { grid-column: 1 / -1; }
.expired { max-width: 560px; margin: 12px auto 48px; }
.checkout-summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: sticky; top: 20px;
}
.summary-cover { aspect-ratio: 16 / 7; border-radius: 12px; display: flex; align-items: flex-end; padding: 14px; margin-bottom: 18px; }
.summary-cover .cover-title { font-size: 24px; }
.summary-event { font-size: 22px; }
.checkout-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
}
.form-title { font-family: var(--display); font-size: 26px; margin-bottom: 20px; }
.reservation {
  background: rgba(212, 255, 58, .1); color: var(--accent); font-size: 14px; font-weight: 500;
  border-radius: 10px; padding: 10px 14px; margin: 0 0 18px;
}
.reservation strong { font-variant-numeric: tabular-nums; }
.reservation.is-urgent { background: rgba(255, 92, 122, .12); color: var(--danger); }
.subscription-checkout-note { padding: 14px; border: 1px solid rgba(212,255,58,.25); border-radius: 12px; color: var(--muted); background: rgba(212,255,58,.06); font-size: 13px; line-height: 1.55; }
.subscription-next { color: var(--muted); font-size: 12px; text-align: center; margin: 12px 0 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 4px 0 18px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.check a { color: var(--text); }
.field { display: block; margin-bottom: 20px; }
.field > span { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
.field input {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #6b6b7d; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 255, 58, .15); }
.payment-element { min-height: 120px; }
.payment-loading { height: 120px; border-radius: 12px; background: linear-gradient(100deg, var(--surface-2) 40%, var(--line) 50%, var(--surface-2) 60%) 0 0 / 200% 100%; animation: shimmer 1.2s infinite linear; }
.form-error {
  background: rgba(255, 92, 122, .12); color: var(--danger); font-weight: 500; font-size: 14px;
  border-radius: 10px; padding: 10px 14px; margin: 0 0 12px;
}
.pay-button { font-size: 17px; padding: 16px 28px; gap: 10px; }
.spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(11, 11, 16, .25); border-top-color: var(--accent-ink);
  animation: spin .7s linear infinite;
}
.btn { gap: 10px; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading:disabled { opacity: .8; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
.powered { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.powered strong { color: var(--text); }

@media (max-width: 760px) {
  .checkout { grid-template-columns: 1fr; gap: 16px; }
  .checkout-summary { position: static; }
  .summary-cover { display: none; }
  .checkout-form { padding: 22px; }
}

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }
.footer p { margin: 8px 0 0; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--text); }
body.has-buybar .footer { padding-bottom: 8px; }

/* Páginas legales */
.legal { max-width: 760px; padding-bottom: 48px; }
.legal h1 { font-family: var(--display); font-size: clamp(30px, 6vw, 40px); margin: 8px 0 8px; }
.legal h2 { font-size: 19px; margin: 32px 0 8px; }
.legal p, .legal li { color: #cfcfdb; }
.legal .updated { color: var(--muted); font-size: 14px; }
.fill { background: rgba(255, 184, 0, .15); color: #ffb800; padding: 0 4px; border-radius: 4px; }

@media (max-width: 520px) {
  .panel { padding: 22px; }
  .ticket { padding: 14px; }
}

.sent-to { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 16px 0 0; font-size: 14px; color: #cfcfdb; }
