* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --bg: #0b0f19;
  --panel: #111927;
  --panel-2: #161c2a;
  --border: rgba(255,255,255,.08);
  --accent: #00d9d9;
  --accent-ink: #06222a;
  --text: #f5f7fb;
  --text-soft: #a6b0c3;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ff5c5c;
  --teal: #2dd4bf;
}
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}
.back-link { color: var(--text-soft); text-decoration: none; font-size: .85rem; }
.back-link:hover { color: var(--accent); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

main { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }

.intro { max-width: 720px; margin: 0 auto 32px; text-align: center; }
.intro-eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.intro h1 { font-size: 1.9rem; margin: 0 0 14px; line-height: 1.25; }
.intro p { color: var(--text-soft); line-height: 1.6; font-size: .96rem; }
.intro-actions { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 24px; flex-wrap: wrap; }

.btn-play {
  background: linear-gradient(135deg, var(--accent), #00b8b8);
  color: var(--accent-ink); border: none; border-radius: 10px;
  padding: 13px 26px; font-weight: 700; font-size: .95rem; cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.btn-play:hover { transform: translateY(-1px); }
.btn-play:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.subtitle-toggle {
  display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-soft); cursor: pointer;
}
.subtitle-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- Contenedor del reel: SIEMPRE vertical (9:16) ---------- */
.reel-wrap { max-width: 420px; margin: 0 auto; position: relative; }
.reel-wrap:fullscreen,
.reel-wrap.pseudo-fullscreen {
  max-width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #000;
}
.reel-wrap.pseudo-fullscreen { position: fixed; inset: 0; z-index: 9999; }
/* Fix del aspect-ratio en pantalla completa (doc69): forzar solo la altura y dejar el ancho en
   auto -- si se deja width:100% el canvas pierde la proporción 9:16 en desktop. */
.reel-wrap:fullscreen .reel-canvas,
.reel-wrap.pseudo-fullscreen .reel-canvas {
  width: auto;
  height: min(100vh, 780px);
  max-width: 100%;
}
body.pseudo-fullscreen-lock { overflow: hidden; }

.btn-reel-fullscreen {
  position: absolute; top: 10px; right: 10px; z-index: 20;
  background: rgba(10,14,22,.75); border: 1px solid var(--border); color: var(--text-soft);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: .95rem;
}
.btn-reel-fullscreen:hover { color: var(--accent); border-color: var(--accent); }

.reel-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 34px;
  border: 10px solid #1c2536;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  overflow: hidden;
}

.reel-scene { position: absolute; inset: 0; display: flex; flex-direction: column; }
.reel-phone-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34%; height: 22px; background: #05070c; border-radius: 0 0 14px 14px; z-index: 5;
}

/* ---------- Escena A: gancho (bandeja + formulario sueltos, contraste "antes") ---------- */
.reel-scene-hook { background: #05070c; align-items: center; justify-content: center; padding: 0 20px; }
.hook-stack { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.hook-mini {
  position: relative; background: #0d1420; border: 1px dashed rgba(255,255,255,.18);
  border-radius: 10px; padding: 16px 14px;
}
.hook-mini-head { font-size: .72rem; font-weight: 600; color: #7d8798; }
.hook-mini-sub { margin-top: 8px; font-size: .6rem; color: #566072; }
.hook-mini-badge {
  position: absolute; top: -8px; right: -6px; background: var(--red); color: #fff;
  font-size: .58rem; font-weight: 800; border-radius: 20px; padding: 3px 8px;
}

/* ---------- Escena B: mail -> ticket, card flip 3D ---------- */
.reel-scene-flip { background: #05070c; align-items: center; justify-content: center; padding: 0 20px; }
.flip-stage { width: 100%; perspective: 900px; }
.flip-card {
  position: relative; width: 100%; min-height: 150px;
  transform-style: preserve-3d; transition: transform .7s cubic-bezier(.4,.2,.2,1);
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 12px; padding: 18px 16px; display: flex; flex-direction: column; gap: 8px;
}
.flip-front { background: #161c2a; border: 1px solid rgba(255,255,255,.12); }
.mail-mini-icon { font-size: 1.3rem; }
.mail-mini-from { font-size: .64rem; color: var(--text-soft); }
.mail-mini-subject { font-size: .78rem; font-weight: 600; color: var(--text); }
.flip-back {
  background: var(--panel); border: 1px solid rgba(255,255,255,.12); transform: rotateY(180deg);
  justify-content: center; gap: 10px;
}
.ticket-mini-row { display: flex; align-items: center; gap: 8px; }
.ticket-mini-id { font-size: .72rem; font-weight: 700; color: var(--text); }
.ticket-mini-asunto { font-size: .68rem; color: var(--text-soft); }

.tickets-badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px;
  font-size: .56rem; font-weight: 700;
}
.tickets-badge-formulario { background: rgba(0,217,217,.15); color: var(--accent); }
.tickets-badge-mail { background: rgba(245,158,11,.15); color: var(--orange); }
.tickets-badge-estado-abierto { background: rgba(16,185,129,.15); color: var(--green); width: fit-content; }
.tickets-badge-estado-cerrado { background: rgba(255,255,255,.08); color: var(--text-soft); width: fit-content; }

/* ---------- Escena C: widget real del Formulario Web ---------- */
.reel-scene-phone { background: #05070c; }
.reel-site-mock { position: absolute; inset: 0; padding: 30px 16px 16px; }
.reel-site-mock-topbar { height: 10px; width: 40%; background: rgba(255,255,255,.12); border-radius: 4px; margin-bottom: 22px; }
.reel-site-mock-hero { display: flex; flex-direction: column; gap: 10px; }
.reel-site-mock-line { height: 12px; background: rgba(255,255,255,.08); border-radius: 4px; }
.reel-site-mock-line.w70 { width: 70%; }
.reel-site-mock-line.w40 { width: 40%; }

/* réplica del tema "oscuro estándar" real del widget (form_window.php, standard_dark) */
.aurell-form-card {
  position: absolute; left: 14px; right: 14px; bottom: 14px; top: 90px;
  background: #161c2a; border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  padding: 16px 16px 14px; display: flex; flex-direction: column; overflow: hidden;
  animation: popIn .25s ease; box-shadow: 0 14px 40px rgba(0,0,0,.4);
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.aurell-form-head { font-size: .82rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.aurell-form-body { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.aurell-form-field label { display: block; font-size: .62rem; font-weight: 600; color: #c7d0de; margin-bottom: 6px; }
.aurell-form-field input, .aurell-form-field textarea {
  width: 100%; background: #0f172a; border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font-size: .66rem; font-family: inherit; resize: none;
}
.aurell-form-submit {
  margin-top: 2px; background: var(--accent); color: var(--accent-ink); border: none;
  border-radius: 8px; padding: 10px; font-weight: 700; font-size: .68rem; text-align: center;
}
.aurell-form-thanks { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; animation: popIn .25s ease; }
.aurell-reserva-thanks-icon {
  width: 46px; height: 46px; border-radius: 50%; background: rgba(0,217,217,.14); color: #00d9d9;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.aurell-reserva-thanks-icon svg { width: 22px; height: 22px; }
.aurell-form-thanks h3 { margin: 0 0 6px; font-size: .8rem; color: var(--text); }
.aurell-form-thanks p { color: #a9b4c9; margin: 2px 0; font-size: .62rem; }

/* ---------- Escena D: escritorio de tickets, mockup de laptop ---------- */
.reel-scene-laptop { background: #05070c; align-items: center; justify-content: center; padding: 0 14px; }
.reel-laptop-mock { width: 100%; animation: popIn .25s ease; }
.reel-laptop-screen {
  background: var(--panel); border: 2px solid #263047; border-radius: 8px 8px 2px 2px;
  aspect-ratio: 16 / 10; overflow: hidden; display: flex; flex-direction: column;
}
.reel-laptop-base { height: 8px; background: linear-gradient(180deg, #263047, #1c2536); border-radius: 0 0 6px 6px; margin: 0 -6px; }
.reel-laptop-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.escritorio-mini-panel { flex-direction: row; }
.escritorio-mini-lista { width: 34%; border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.escritorio-mini-lista-head { padding: 6px 8px; font-size: .56rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); border-bottom: 1px solid var(--border); }
.escritorio-mini-lista-ul { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.escritorio-mini-item {
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 5px; cursor: default;
}
.escritorio-mini-item.selected { background: rgba(0,217,217,.1); }
.escritorio-mini-item.entering { animation: itemPulse 1s ease; }
@keyframes itemPulse { 0% { background: rgba(0,217,217,.35); } 100% { background: transparent; } }
.escritorio-mini-item-txt { font-size: .5rem; font-weight: 600; color: var(--text); }
.escritorio-mini-item .tickets-badge { padding: 2px 6px; font-size: .44rem; }

.escritorio-mini-detalle { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; padding: 8px; }
.escritorio-mini-vacio { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-soft); font-size: .56rem; }
.escritorio-mini-abierto { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 6px; animation: itemPulse .3s ease; }

.escritorio-mini-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.escritorio-mini-remitente { font-size: .5rem; font-weight: 700; color: var(--text); }
.escritorio-mini-head small { font-size: .42rem; color: var(--text-soft); }
.badge-estado-respuesta {
  font-size: .42rem; font-weight: 700; padding: 3px 7px; border-radius: 20px; white-space: nowrap;
}
.badge-estado-respuesta.sin-responder { background: rgba(239, 68, 68, .15); color: #ef4444; }
.badge-estado-respuesta.respondido { background: rgba(45, 212, 191, .15); color: var(--teal); }

.escritorio-mini-mensaje {
  font-size: .48rem; color: var(--text-soft); background: rgba(255,255,255,.03);
  border-radius: 5px; padding: 6px 7px; line-height: 1.4;
}
.escritorio-mini-selects { display: flex; gap: 5px; }
.escritorio-mini-selects select {
  flex: 1; background: #0f172a; border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 5px; color: var(--text); font-size: .42rem; font-family: inherit;
}

.escritorio-mini-hist { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; min-height: 0; }
.comentario-mini {
  font-size: .44rem; padding: 5px 6px; border-radius: 4px; background: rgba(255,255,255,.03);
  border-left: 3px solid var(--accent); color: var(--text); animation: itemPulse .3s ease;
}

.ticket-responder-mini { display: flex; gap: 4px; }
.ticket-responder-mini textarea {
  flex: 1; background: #0f172a; border: 1px solid var(--border); border-radius: 5px;
  padding: 4px 6px; color: var(--text); font-size: .44rem; font-family: inherit; resize: none; height: 26px;
}
.ticket-responder-mini button {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 5px;
  padding: 0 8px; font-size: .44rem; font-weight: 700;
}

/* ---------- Escena final ---------- */
.reel-scene-outro {
  background: radial-gradient(circle at 50% 40%, #101c2c, #05070c 70%);
  align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 20px;
  animation: popIn .3s ease;
}
.outro-logo { width: 64px; height: auto; margin-bottom: 4px; }
.outro-brand { font-size: 1.3rem; font-weight: 800; }
.outro-brand span { color: var(--accent); }
.outro-tag { font-size: .7rem; color: var(--text-soft); }
.outro-cta { margin-top: 10px; font-size: .72rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; }

/* ---------- Subtítulos ---------- */
.reel-subtitle-bar {
  position: absolute; left: 10px; right: 10px; bottom: 14px; z-index: 10;
  text-align: center; font-size: .82rem; line-height: 1.45; color: var(--text);
  background: rgba(10, 14, 22, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 9px 12px;
  animation: subtitleIn .2s ease;
}
.reel-subtitle-bar.reel-subtitle-top { top: 30px; bottom: auto; }
@keyframes subtitleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.replay-wrap { text-align: center; margin-top: 20px; }
.btn-replay { background: transparent; border: 1px solid var(--accent); color: var(--accent); }

.footnote { max-width: 640px; margin: 36px auto 0; text-align: center; }
.footnote p { color: var(--text-soft); font-size: .78rem; line-height: 1.6; }
.footnote a { color: var(--accent); }

.aurell-form-body, .escritorio-mini-lista-ul, .escritorio-mini-hist {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}
