/* ============================================================
   TIKOLIN — sistema de diseño v2
   El objeto central del producto es un tablero de números:
   la cuadrícula de números es el elemento protagonista en toda
   la interfaz, con colores de estado inconfundibles.
   ============================================================ */

/* ---------- Fuentes (vendorizadas localmente) ---------- */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400; src: url("../vendor/fonts/space-grotesk-latin-400-normal.1a806675790e.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; src: url("../vendor/fonts/space-grotesk-latin-500-normal.ab4861869c91.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; src: url("../vendor/fonts/space-grotesk-latin-600-normal.49f2dd2d2132.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; src: url("../vendor/fonts/space-grotesk-latin-700-normal.f9e147a59a93.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; src: url("../vendor/fonts/inter-latin-400-normal.da03732a27e1.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; src: url("../vendor/fonts/inter-latin-500-normal.51205681a1ba.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; src: url("../vendor/fonts/inter-latin-600-normal.2ede57db1a3a.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; src: url("../vendor/fonts/inter-latin-700-normal.8ca0a5155296.woff2") format("woff2"); }

:root {
  --ink: #14161F;
  --ink-soft: #4A4C5A;
  --paper: #FAFAF9;
  --surface: #FFFFFF;
  --line: #E4E3E8;
  --violet: #4B3AA4;
  --violet-deep: #372B7A;
  --violet-wash: #F1EEFC;
  --available: #1C9C6E;
  --available-wash: #E7F7F0;
  --reserved: #E1A94C;
  --reserved-wash: #FDF3E1;
  --sold: #C0435B;
  --sold-wash: #FBEAED;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(20,22,31,.04), 0 12px 28px -14px rgba(20,22,31,.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--violet-deep); }

/* ---------- Navbar ---------- */
.rf-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.rf-nav .navbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink) !important;
}
.rf-nav .nav-link {
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft) !important;
  font-weight: 500;
  font-size: .94rem;
  padding: .75rem .85rem;
  line-height: 1;
}
.rf-nav .nav-link:hover { color: var(--violet) !important; }
.rf-nav .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--ink);
  color: var(--ink) !important;
  border-radius: var(--radius-sm);
  padding: .75rem 1.4rem;
  line-height: 1;
  font-weight: 600;
  font-size: .92rem;
}
.rf-nav .btn-ghost:hover { background: var(--ink); color: var(--paper) !important; }
.rf-nav li:last-child .btn-ghost {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff !important;
}
.rf-nav li:last-child .btn-ghost:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- Buttons ---------- */
.btn-rf-primary {
  background: var(--violet);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .7rem 1.5rem;
  font-weight: 600;
  font-size: .96rem;
  transition: background .15s, transform .1s;
}
.btn-rf-primary:hover { background: var(--violet-deep); color: #fff; }
.btn-rf-primary:active { transform: translateY(1px); }
.btn-rf-primary.disabled, .btn-rf-primary:disabled {
  background: var(--line); color: #9a9aa5; pointer-events: none;
}
.btn-rf-outline {
  background: transparent; color: var(--violet);
  border: 1.5px solid var(--violet); border-radius: var(--radius-sm);
  padding: .65rem 1.4rem; font-weight: 600;
}
.btn-rf-outline:hover { background: var(--violet-wash); color: var(--violet-deep); }

/* ---------- Hero ---------- */
/* overflow:hidden evita que la mascota (posicionada absoluta, "de pie
   delante del tablero") se salga del hero y se monte sobre el navbar */
.rf-hero { padding: 4.5rem 0 3.5rem; overflow: hidden; }
.rf-hero h1 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  max-width: 15ch;
  margin-bottom: 1rem;
}
.rf-hero p.lead { color: var(--ink-soft); font-size: 1.1rem; max-width: 48ch; margin-bottom: 1.75rem; }
.rf-hero .stat-row { display: flex; gap: 2.25rem; flex-wrap: wrap; margin-top: 2.5rem; }
.rf-hero .stat .num { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: var(--violet); line-height: 1; }
.rf-hero .stat .label { font-size: .84rem; color: var(--ink-soft); margin-top: .25rem; }

/* ---------- Mascota (Tikolín) parada delante del tablero ---------- */
.mascota-stage { position: relative; max-width: 100%; width: 480px; margin: 0 auto 2rem; }

@media (min-width: 992px) {
  .mascota-stage { margin: 0 0 0 auto; }
}
.mascota-wrap {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 68%; transform: translate(-50%, -50%);
  pointer-events: none;
  /* desvanece monedas/confeti que llegan al borde en vez de cortarlos de golpe */
  -webkit-mask-image: radial-gradient(ellipse 62% 56% at 50% 48%, #000 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 56% at 50% 48%, #000 78%, transparent 100%);
}
.mascota-static { width: 100%; height: auto; display: block; }

/* mini tablero decorativo del hero */
.hero-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; max-width: 480px; }
.hero-board span {
  aspect-ratio: 1; border-radius: 6px; background: var(--available-wash); border: 1.5px solid var(--available);
}
.hero-board span:nth-child(3n) { background: var(--reserved-wash); border-color: var(--reserved); }
.hero-board span:nth-child(7n) { background: var(--sold-wash); border-color: var(--sold); }

@media (min-width: 1200px) {
  .mascota-stage { width: 540px; }
  .hero-board { max-width: 540px; }
}

@media (min-width: 1400px) {
  .mascota-stage { width: 600px; }
  .hero-board { max-width: 600px; }
}

/* ---------- Room card ---------- */
.room-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform .15s, box-shadow .15s;
}
.room-card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(20,22,31,.06), 0 20px 36px -16px rgba(20,22,31,.24); }
.room-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.room-card .room-tag { font-size: .8rem; color: var(--violet); font-weight: 600; margin-bottom: .3rem; }
.room-card h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.room-card-desc { font-size: clamp(.82rem, 2vw, .88rem); color: var(--ink-soft); margin-bottom: 1rem; line-height: 1.4; }
.room-card-stats { display: flex; align-items: center; gap: 1rem; margin-top: auto; padding-top: 1rem; }
.room-card-donut { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.room-card-donut canvas { width: 64px !important; height: 64px !important; }
.room-card-donut .donut-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: .8rem; color: var(--ink);
}
.room-card-figures { flex: 1; }
.room-card-figures .price { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--ink); line-height: 1; }
.room-card-figures .price strong { font-weight: 700; }
.room-card-figures .price small,
.room-card-figures > small { font-family: var(--font-body); font-weight: 500; font-size: .74rem; color: var(--ink-soft); display: block; margin-top: .2rem; }
.room-card-footer { border-top: 1px solid var(--line); padding: .9rem 1.5rem; background: var(--paper); }
.room-card-footer a { font-weight: 600; font-size: .92rem; display: flex; align-items: center; justify-content: space-between; color: var(--violet); }
.room-card-image { width: 100%; aspect-ratio: 16/9; object-fit: contain; display: block; background: #FFFFFF; }
.room-card-footer a:hover { color: var(--violet-deep); }

/* ---------- Number board (protagonista) ---------- */
.board-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.board-panel-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .75rem; position: relative; background-size: cover; background-position: center; }
.board-panel-header.has-bg { color: #fff; }
.board-panel-header.has-bg::before { content: ""; position: absolute; inset: 0; background: rgba(20,22,31,.62); }
.board-panel-header.has-bg > * { position: relative; z-index: 1; }
.board-panel-header.has-bg h2 { color: #fff; }
.board-panel-header.has-bg .board-panel-header-text p { color: rgba(255,255,255,.85); }
.board-panel-header.has-bg .board-legend { color: rgba(255,255,255,.85); }
.prize-photo { width: 100%; max-height: 220px; object-fit: contain; background: #FFFFFF; border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.board-panel-header-text { flex: 1 1 260px; }
.board-panel-header h2 { font-size: 1.15rem; margin: 0 0 .35rem; }
.board-panel-header-text p { color: var(--ink-soft); }
.board-legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .84rem; color: var(--ink-soft); flex-shrink: 0; padding-top: .2rem; }
.board-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }
.board-panel-body { padding: 1.5rem; }

.number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 10px;
}
.number-chip {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: transform .12s, border-color .12s, background .12s, box-shadow .12s;
}
.number-chip.available:hover {
  border-color: var(--available); background: var(--available-wash);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 16px -8px rgba(28,156,110,.45);
}
.number-chip.mine { background: var(--violet); color: #fff; border-color: var(--violet); }
.number-chip.reserved:not(.mine) { background: var(--reserved-wash); border-color: var(--reserved); color: #8a6416; cursor: not-allowed; }
.number-chip.sold { background: var(--sold-wash); border-color: var(--sold); color: var(--sold); opacity: .85; cursor: not-allowed; }

/* ---------- Selection / side panels ---------- */
.side-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.side-panel-header { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.side-panel-body { padding: 1.4rem; }
.side-panel-footer { padding: 1.1rem 1.4rem; border-top: 1px solid var(--line); background: var(--paper); }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; background: #fff;
}
.form-control:focus, .form-select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-wash); }
label.form-label { font-size: .88rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .35rem; }

/* ---------- Badges ---------- */
.rf-badge { display: inline-block; padding: .28rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.rf-badge-verified { background: var(--available-wash); color: var(--available); }
.rf-badge-pending { background: var(--reserved-wash); color: #8a6416; }
.rf-badge-rejected { background: var(--sold-wash); color: var(--sold); }
.rf-badge-inactive { background: var(--line); color: var(--ink-soft); }

/* ---------- Soporte ---------- */
.soporte-icono { flex-shrink: 0; color: var(--violet); display: inline-flex; }
.footer-soporte { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.footer-soporte a { color: var(--ink-soft); display: inline-flex; align-items: center; }
.footer-soporte a:hover { color: var(--violet); }

/* ---------- Footer ---------- */
.rf-footer { background: var(--surface); border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .85rem; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); border: 1px solid var(--line); font-size: .92rem; }
.alert-success { background: var(--available-wash); border-color: var(--available); color: #0e6b4c; }
.alert-warning { background: var(--reserved-wash); border-color: var(--reserved); color: #8a6416; }
.alert-danger, .alert-error { background: var(--sold-wash); border-color: var(--sold); color: var(--sold); }
.alert-info { background: var(--violet-wash); border-color: var(--violet); color: var(--violet-deep); }

@media (max-width: 576px) {
  .rf-hero { padding: 2.75rem 0 2.25rem; }
  .mascota-stage { width: 280px; }
  .number-grid { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
}

/* ---------- Animación de sorteo ---------- */
@keyframes rf-pulse-spin {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.08); opacity: 1; }
}
#spinningNumber { animation: rf-pulse-spin .5s ease-in-out infinite; }

@keyframes rf-reveal-pop {
  0% { transform: scale(.7); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
#revealView, #finalNumber { animation: rf-reveal-pop .5s ease-out; }

/* ---------- Flyer de bienvenida (popup) ---------- */
.flyer-overlay {
  position: fixed; inset: 0; z-index: 1050;
  background: rgba(20, 22, 31, .6);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.flyer-overlay[hidden] { display: none; }
.flyer-card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 360px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  animation: flyer-pop .25s ease-out;
}
@keyframes flyer-pop {
  0% { transform: scale(.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
/* Tamaño responsivo fijo — nunca cubre la pantalla completa, sin
   importar el tamaño real de la imagen que se suba. */
.flyer-img { width: 100%; max-height: min(80vh, 600px); height: auto; object-fit: contain; display: block; }
.flyer-close {
  position: absolute; top: .6rem; right: .6rem; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(20, 22, 31, .55); color: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.flyer-close:hover { background: rgba(20, 22, 31, .8); }

/* ---------- Datos de pago copiables ---------- */
.dato-pago-row { border-bottom: 1px dashed rgba(0,0,0,.1); }
.dato-pago-row:last-child { border-bottom: none; }
.dato-pago-valor { font-family: monospace; word-break: break-all; }
.btn-copiar-dato {
  flex-shrink: 0;
  border: 1px solid var(--violet);
  color: var(--violet);
  background: transparent;
  border-radius: var(--radius-sm);
  padding: .25rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-copiar-dato:hover { background: var(--violet); color: #fff; }
