:root {
  --bg: #05060f;
  --bg-2: #0b0e24;
  --card: #0f1330;
  --line: #232850;
  --text: #ffffff;
  --muted: #a9afd0;
  --blue: #3b5bff;
  --orange: #ff8a00;
  --yellow: #ffc400;
  --grad: linear-gradient(135deg, var(--yellow), var(--orange));
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html, body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--orange); }
.container { width: min(1100px, 100% - 32px); margin-inline: auto; }

.brand {
  font-weight: 900; font-style: italic; letter-spacing: -.02em;
  font-size: 1.6rem; text-decoration: none; color: var(--text);
}
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.topbar { border-bottom: 1px solid var(--line); background: rgba(5,6,15,.9); position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 10; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.topbar nav { display: flex; align-items: center; gap: 16px; font-size: .95rem; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--text); }
.topbar form { margin: 0; }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 12px 22px; border-radius: 999px; color: #1a0f00; background: var(--grad);
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--orange); }
.btn-sm { padding: 8px 16px; font-size: .8rem; }

.hero {
  position: relative; min-height: 78vh; display: grid; place-items: center; text-align: center;
  background:
    linear-gradient(180deg, rgba(5,6,15,.35), rgba(5,6,15,.15) 45%, var(--bg) 97%),
    url("/img/hero.webp") center/cover no-repeat, var(--bg);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 780px) {
  .hero {
    min-height: 64vh; padding: 48px 0;
    background:
      linear-gradient(180deg, rgba(5,6,15,.35), rgba(5,6,15,.15) 45%, var(--bg) 97%),
      url("/img/hero-mobile.webp") center/cover no-repeat, var(--bg);
  }
}
.hero h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 4.5rem); font-style: italic; font-weight: 900; letter-spacing: -.02em; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 36ch; margin: 12px auto 28px; }
.accent { color: var(--orange); }

.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; padding: 48px 0; }
.cat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; text-align: center; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.auth { display: grid; place-items: center; padding: 56px 0; }
.auth .card { width: min(420px, 100%); }
.auth h1, .page h1 { margin-top: 0; font-style: italic; font-weight: 900; }

label { display: block; font-size: .85rem; color: var(--muted); margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit;
}
input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.pass-toggle {
  position: absolute; top: 0; right: 0; height: 100%; width: 44px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.pass-toggle:hover { color: var(--text); }
.pass-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.pass-toggle svg { width: 20px; height: 20px; }
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; font-size: .9rem; }
.alert-error { background: #3a0f1a; border: 1px solid #7a1f33; }
.alert-ok { background: #0f2a1f; border: 1px solid #1f6b4a; }
.page { padding: 40px 0; }
.muted { color: var(--muted); }
.footer { color: var(--muted); font-size: .85rem; padding: 32px 0; border-top: 1px solid var(--line); margin-top: 40px; }

/* Eventos */
.grid-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; padding: 32px 0 8px; }
.ev-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.ev-card:hover { transform: translateY(-3px); border-color: var(--orange); }
.ev-img { aspect-ratio: 16/9; background: linear-gradient(135deg, #1a2268, #3b1d6e) center/cover no-repeat; }
.ev-body { padding: 16px 18px 20px; }
.ev-body h3 { margin: 4px 0 6px; font-size: 1.15rem; }
.ev-date { color: var(--orange); font-weight: 700; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.price { font-weight: 700; }
.section-title { font-style: italic; font-weight: 900; font-size: 1.6rem; margin: 40px 0 0; }
.ev-hero { aspect-ratio: 21/8; background: linear-gradient(135deg, #1a2268, #3b1d6e) center/cover no-repeat; border-radius: 16px; margin-bottom: 24px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }
.tt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tt:last-child { border-bottom: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); }
.badge-PUBLICADO { color: #5cf0a8; border-color: #1f6b4a; }
.badge-BORRADOR { color: var(--yellow); border-color: #6b5a1f; }
.badge-CANCELADO { color: #ff7a8a; border-color: #7a1f33; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
input[type=number], input[type=datetime-local], textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; color-scheme: dark;
}
textarea { min-height: 120px; resize: vertical; }
select {
  width: 100%; padding: 12px 40px 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background-color: var(--bg-2); color: var(--text); font: inherit; color-scheme: dark; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239aa4b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
select option { background: var(--bg-2); color: var(--text); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-danger { background: transparent; color: #ff7a8a; border: 1px solid #7a1f33; }
.field-error { color: #ff7a8a; font-size: .85rem; margin-top: 4px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
select.qty { width: auto; padding: 10px 36px 10px 12px; min-width: 72px; }

/* Entradas con QR */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ticket { text-align: center; }
.ticket img { background: #fff; border-radius: 12px; padding: 8px; margin: 12px auto; display: block; max-width: 100%; height: auto; }
.ticket .code { font-family: ui-monospace, monospace; font-size: 1.3rem; letter-spacing: .15em; }
.ticket-off img { opacity: .35; }

/* Puerta */
.gate-result { border-radius: 16px; padding: 24px; text-align: center; margin: 16px 0; border: 2px solid var(--line); }
.gate-result.idle { background: var(--card); }
.gate-result.ok { background: #0f2a1f; border-color: #1f9a63; }
.gate-result.bad { background: #3a0f1a; border-color: #d33a58; }
.gate-title { font-size: 1.6rem; font-weight: 900; }
.gate-video { width: 100%; max-height: 50vh; border-radius: 16px; background: #000; object-fit: cover; margin-bottom: 12px; }
.gate-hits { list-style: none; padding: 0; margin: 12px 0 0; }
.gate-hits li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.badge-offline { background: #7a1f33; }

/* Landing */
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
html { scroll-behavior: smooth; }
.audiences { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 56px; }
.aud h2 { margin: 8px 0 14px; font-size: 1.5rem; font-style: italic; font-weight: 900; }
.aud-org { border-color: var(--orange); }
.eyebrow { color: var(--orange); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ticks { list-style: none; padding: 0; margin: 0 0 20px; }
.ticks li { position: relative; padding: 6px 0 6px 26px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--orange); font-weight: 900; }
.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.steps b { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #1a0f00; }
.steps h3 { margin: 12px 0 6px; }
.steps p { margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 20px; max-width: 760px; }
.plan h3 { margin: 0; font-size: 1.2rem; }
.plan-price { font-size: 2.2rem; font-weight: 900; margin: 6px 0 14px; }
.plan-pro { border-color: var(--blue); }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 10px 0 0; }
.final-cta { text-align: center; margin-top: 56px; padding: 40px 28px; }
.final-cta h2 { margin: 0 0 6px; font-style: italic; font-weight: 900; }

/* Registro: tipo de cuenta */
.account-type { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 8px; }
.account-type label { margin: 0; cursor: pointer; }
.account-type input { position: absolute; opacity: 0; pointer-events: none; }
.account-type span { display: block; text-align: center; padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--text); font-weight: 700; }
.account-type small { display: block; font-weight: 400; color: var(--muted); }
.account-type input:checked + span { border-color: var(--orange); background: #1b1630; }
.account-type input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.plan-note { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: .9rem; margin-bottom: 16px; }
.plan-note-reg { display: none; }
.account-type:has(input[value=organizar]:checked) ~ .plan-note-reg { display: block; }

/* Barra superior: nunca desborda; el menú de usuario es un avatar con desplegable */
.topbar .brand { flex: none; }
.topbar nav { min-width: 0; }
.topbar nav > a { white-space: nowrap; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #1a0f00; font-weight: 900; text-transform: uppercase; overflow: hidden; }
.user-pop { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; max-width: calc(100vw - 32px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.user-name { font-weight: 700; overflow-wrap: anywhere; }
.user-mail { font-size: .85rem; overflow-wrap: anywhere; }
.user-pop a, .user-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; }
.user-pop a:hover, .user-pop button:hover { color: var(--orange); }
@media (max-width: 480px) {
  .topbar .container { gap: 8px; }
  .topbar nav { gap: 10px; font-size: .85rem; }
  .brand { font-size: 1.35rem; }
  .btn-sm { padding: 7px 12px; }
}

/* Admin: listados */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.filters input[type=text] { flex: 1 1 220px; width: auto; }
.table-wrap { overflow-x: auto; }
.img-preview { aspect-ratio: 16/9; max-width: 320px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2) center/cover no-repeat; margin-bottom: 8px; }

.img-empty { display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.img-empty::after { content: "Sin imagen"; }
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-pick label.btn { margin: 0; cursor: pointer; font-size: .8rem; color: var(--text); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.file-pick:focus-within label.btn { outline: 2px solid var(--blue); outline-offset: 2px; }
.footer-row { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.credits a { color: var(--muted); }
.credits a:hover { color: var(--orange); }
.credits { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.stats strong { display: block; font-size: 1.6rem; line-height: 1.2; }
.stats span { color: var(--muted); font-size: .85rem; }
