/**
 * LivePoll — Hoja de Estilos Universal
 * Sistema de diseño CSS moderno, autónomo y 100% funcional sin dependencias externas ni CDN.
 * Compatible con todos los navegadores modernos y pantallas móviles.
 */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --success: #10b981;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

img {
  max-width: 100%;
  height: auto;
}

/* ====================================================================
   Layout y Contenedores
   ==================================================================== */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
}

.container-wide {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ====================================================================
   Componentes de Tarjeta y Superficie
   ==================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-lg {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 32px;
}

/* ====================================================================
   Botones
   ==================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}
.btn-success:hover {
  background: #059669;
  color: #ffffff;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

.btn-danger-light {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: #fecaca;
}
.btn-danger-light:hover {
  background: #fee2e2;
  color: #991b1b;
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* ====================================================================
   Formularios e Inputs
   ==================================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.input-field {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.input-field:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-pin {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 6px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--border);
}
.input-pin:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* ====================================================================
   Badges y Pastillas
   ==================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #bbf7d0;
}

.badge-active {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.badge-closed {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ====================================================================
   Estilos de la Página de Inicio (Landing Page)
   ==================================================================== */
.landing-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.landing-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-left: 10px;
}

.landing-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 32px 20px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.2;
  color: #0f172a;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 46px;
  }
}

.hero-subtitle {
  font-size: 17px;
  color: #475569;
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto 36px auto;
}

.join-card-wrapper {
  max-width: 440px;
  margin: 0 auto 36px auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 32px 28px;
  text-align: left;
}

.features-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 40px;
}

.feature-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot-green { width: 8px; height: 8px; border-radius: 50%; background: #10b981; }
.dot-blue { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; }
.dot-amber { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }

.landing-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 24px 0;
  font-size: 13px;
  color: #64748b;
}

.landing-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .landing-footer-inner {
    flex-direction: row;
  }
}

/* ====================================================================
   Soporte para Clases Tailwind Utility en Fallback
   ==================================================================== */
.bg-white { background-color: #ffffff; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-blue-600 { background-color: #2563eb; }
.text-slate-900 { color: #0f172a; }
.text-slate-700 { color: #334155; }
.text-slate-600 { color: #475569; }
.text-slate-500 { color: #64748b; }
.text-blue-600 { color: #2563eb; }
.text-white { color: #ffffff; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-4xl { font-size: 36px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border { border-width: 1px; border-style: solid; }
.border-slate-200 { border-color: #e2e8f0; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-16 { padding-top: 64px; padding-bottom: 64px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-10 { margin-bottom: 40px; }
.max-w-md { max-width: 448px; }
.max-w-4xl { max-width: 896px; }
.max-w-6xl { max-width: 1152px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.space-y-4 > * + * { margin-top: 16px; }

/* ====================================================================
   Pantalla de Presentación 16:9 y Modales
   ==================================================================== */
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.qr-box {
  background: white;
  padding: 32px;
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--text-main);
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-xl);
}
