/* =========================================================
   OSTIUM — Sistema de diseño
   Concepto: el umbral. Cada tarjeta, cada QR, cada acceso
   se enmarca en un arco — la forma de una puerta abierta.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Sora:wght@400;500;600;700&display=swap');

:root {
  /* Color */
  --bg:        #1B1730;
  --bg-2:      #221D3D;
  --surface:   #241F3D;
  --surface-2: #2C2650;
  --line:      #3A3364;
  --accent:    #E8A33D;
  --accent-2:  #5FD4C4;
  --text:      #F5F1E8;
  --text-muted:#A79FC7;
  --danger:    #E86A5E;

  /* Type */
  --font-display: 'Fraunces', serif;
  --font-body: 'Sora', sans-serif;

  /* Layout */
  --radius-arch: 999px 999px 12px 12px;
  --radius: 14px;
  --container: 720px;
  --shadow: 0 12px 30px rgba(10, 8, 25, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(232, 163, 61, 0.10), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(95, 212, 196, 0.08), transparent 40%);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0 0 .3em;
}

h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
h3 { font-size: 1.1rem; font-weight: 500; }

p { line-height: 1.55; color: var(--text-muted); margin: 0 0 1em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- El arco: elemento firma ---------- */
.arch {
  border-radius: var(--radius-arch);
  overflow: hidden;
}

.arch-frame {
  position: relative;
  border-radius: var(--radius-arch);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 3px;
}

.arch-top-rule {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 999px 999px 0 0;
}

/* ---------- Header ---------- */
.ostium-header {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.ostium-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
}
.brand .mark {
  width: 26px; height: 26px;
  border: 2px solid var(--accent);
  border-bottom: none;
  border-radius: 999px 999px 0 0;
  display: inline-block;
}

/* ---------- Tarjetas de evento ---------- */
.grid-eventos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 24px 0 60px;
}
@media (min-width: 640px) {
  .grid-eventos { grid-template-columns: 1fr 1fr; }
}

.card-evento {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-arch);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.card-evento:hover { transform: translateY(-3px); border-color: var(--accent); }

.card-evento .cover {
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, var(--surface-2), var(--bg-2));
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}
.card-evento .body { padding: 16px 18px 20px; }
.card-evento .fecha {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  font-weight: 600;
}
.card-evento h3 { margin-top: 6px; color: var(--text); }
.card-evento .lugar { font-size: .85rem; color: var(--text-muted); margin: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
  width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #1B1730; }
.btn-secondary { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

@media (min-width: 560px) {
  .btn { width: auto; }
}

/* ---------- Formularios ---------- */
label { display: block; font-size: .85rem; color: var(--text-muted); margin: 0 0 6px; }
input, select, textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Selector de cantidad de entradas ---------- */
.tipo-entrada {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}
.tipo-entrada:last-child { border-bottom: none; }
.tipo-entrada .nombre { font-weight: 600; color: var(--text); }
.tipo-entrada .precio { color: var(--accent); font-weight: 700; font-family: var(--font-display); }
.tipo-entrada .stock { font-size: .78rem; color: var(--text-muted); }

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.stepper button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}
.stepper span { min-width: 18px; text-align: center; font-weight: 600; }

/* ---------- Barra de total flotante (mobile) ---------- */
.barra-total {
  position: sticky;
  bottom: 0;
  background: rgba(27, 23, 48, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.barra-total .monto { font-family: var(--font-display); font-size: 1.3rem; }

/* ---------- Ticket / entrada individual ---------- */
.ticket {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-arch);
  padding: 4px;
  margin-bottom: 24px;
}
.ticket-inner { padding: 24px; text-align: center; }
.ticket .evento-nombre { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 4px; }
.ticket .evento-meta { color: var(--text-muted); font-size: .88rem; margin-bottom: 20px; }
.ticket .qr-frame {
  display: inline-block;
  background: #fff;
  padding: 14px;
  border-radius: 16px 16px 4px 4px;
  border: 4px solid var(--accent);
  border-bottom: none;
}
.ticket .estado-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-valida { background: rgba(95, 212, 196, .18); color: var(--accent-2); }
.badge-usada { background: rgba(167, 159, 199, .18); color: var(--text-muted); }
.badge-anulada { background: rgba(232, 106, 94, .18); color: var(--danger); }

.ticket .perforado {
  border-top: 2px dashed var(--line);
  margin: 20px 0;
}

/* ---------- Estados vacíos ---------- */
.vacio {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ---------- Utilidades ---------- */
.eyebrow {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  font-weight: 700;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flash {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: .92rem;
}
.flash-ok { background: rgba(95,212,196,.15); color: var(--accent-2); border: 1px solid rgba(95,212,196,.3); }
.flash-error { background: rgba(232,106,94,.15); color: var(--danger); border: 1px solid rgba(232,106,94,.3); }

/* Foco visible accesible */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
