/* Reset y variables CSS */
:root {
  --bg: #0b0b0f;
  --fg: #f5f5f5;
  --muted: #9aa0a6;
  --accent: #ffd400;
  --accent-2: #3ddcff;
  --card: #11131a;
  --border: #202332;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 16px;
  --radius-lg: 24px;
  --maxw: 1680px;
  --g: 16px;
  
  /* Variables tipográficas */
  --font-heading: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lh-heading: 1.15;
  --lh-body: 1.6;
  --tracking-heading: 0.01em;
  --tracking-body: 0em;
}

/* Reset básico */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html,
body {
  font-family: var(--font-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tracking-body);
}

body {
  margin: 0;
  font-size: 16px;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--fg);
  text-decoration: none;
}

button {
  font: inherit;
}

/* Tipografía de encabezados */
h1, h2, h3, h4, .heading, .btn-primary, .nav-brand {
  font-family: var(--font-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-heading);
  font-weight: 700;
}

/* Layout base */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Accesibilidad */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  background: #000;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Secciones base */
.section {
  padding: 56px 0;
  border-top: 1px solid rgba(255, 212, 0, 0.15);
  background: linear-gradient(135deg, #1a1d29 0%, #0b0b0f 50%, #11131a 100%);
  position: relative;
  color: #FFFFFF; /* Texto principal en blanco */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.section p {
  color: #ffffff; /* Texto de párrafos en blanco */
  line-height: 1.7;
}

.section h3,
.section h4,
.section h5,
.section h6 {
  color: #ffd400; /* Títulos secundarios en blanco */
  font-weight: 600;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 212, 0, 0.4), transparent);
  box-shadow: 0 0 8px rgba(255, 212, 0, 0.2);
}

.section h2 {
  margin-top: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.2;
  display: inline-block;
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(255,212,0,.25);
  font-size: clamp(22px, 2.1vw + 10px, 32px);
}

.section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 212, 0, 0.6));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,212,0,.3);
}

/* Componentes base */
.card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(17, 19, 26, 0.8) 100%);
  border: 1px solid rgba(255, 212, 0, 0.1);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow), 0 0 20px rgba(255, 212, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 212, 0, 0.2), transparent);
}

.highlight {
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, rgba(255, 212, 0, 0.05) 0%, rgba(255, 212, 0, 0.02) 100%);
}

/* Botones base modernos */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 16px;
  border: none;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000000;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(255, 215, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s;
}

.btn-accent {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000000;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.btn-outline {
  background: transparent;
  color: #FFD700;
  border: 2px solid #FFD700;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.btn-outline:hover {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000000;
  border-color: #FFD700;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.btn-lg {
  padding: 16px 32px;
  font-weight: 700;
  font-size: 18px;
  border-radius: 20px;
  letter-spacing: 1px;
}

/* Botón Salir - Estilo específico */
.btn-logout,
a[href*="logout.php"].btn {
  background: #000000 !important;
  color: #FFFFFF !important;
  border: 1px solid #FFD700 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.btn-logout:hover,
a[href*="logout.php"].btn:hover {
  background: #1a1a1a !important;
  color: #FFFFFF !important;
  border-color: #FFD700 !important;
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

/* Animaciones base */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* Utilidades de transición */
.fade-out {
  opacity: 0 !important;
  transition: opacity .2s ease;
}

.fade-in {
  animation: fadeIn .22s ease both;
}

/* Media queries base */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  
  .section {
    padding: 40px 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .section {
    padding: 32px 0;
  }
}

/* ========================= FAQ CHATBOT STYLES ========================= */
:root { --faqbot-accent: #FFCC00; /* amarillo SDT */ --faqbot-dark:#0b1020; --faqbot-light:#f8fafc }

/* Botón toggle responsive */
#faqbot-toggle{
  position:fixed; inset:auto 20px 20px auto; z-index:9998;
  border:none; border-radius:999px; padding:12px 16px; cursor:pointer;
  background:var(--faqbot-accent); color:#000; box-shadow:0 8px 24px rgba(0,0,0,.18);
  font:700 14px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  transition: all 0.3s ease;
}

/* Contenedor principal responsive */
#faqbot{
  position:fixed; right:20px; bottom:80px; width:min(420px, 94vw); max-height:min(76vh, 680px);
  display:none; flex-direction:column; z-index:9999; background:#fff; color:#0f172a;
  border:1px solid #e5e7eb; border-radius:20px; overflow:hidden;
  box-shadow:0 16px 48px rgba(2,6,23,.2);
}

/* Responsive breakpoints mejorados */
@media (max-width: 768px) { 
  #faqbot{ 
    right:10px; left:10px; width:auto; bottom:70px;
    max-height:min(80vh, 600px);
    border-radius:16px;
  }
  #faqbot-toggle {
    right:15px; bottom:15px;
    padding:10px 14px;
    font-size:13px;
  }
}

/* Breakpoint específico para tablets */
@media (min-width: 481px) and (max-width: 1024px) {
  #faqbot {
    width:min(450px, 90vw);
    max-height:min(75vh, 650px);
  }
  #faqbot .log {
    min-height:200px; 
    max-height:350px;
  }
}

/* Optimización para desktop */
@media (min-width: 1025px) {
  #faqbot {
    width:420px;
    max-height:680px;
    right:20px;
    bottom:80px;
  }
  #faqbot-toggle {
    right:20px;
    bottom:20px;
    padding:12px 16px;
    font-size:14px;
  }
  #faqbot .log {
    min-height:220px;
    max-height:380px;
  }
}

@media (max-width: 480px) { 
  #faqbot{ 
    right:8px; left:8px; bottom:65px;
    max-height:min(85vh, 550px);
    border-radius:12px;
  }
  #faqbot-toggle {
    right:12px; bottom:12px;
    padding:8px 12px;
    font-size:12px;
  }
}

/* Ajuste específico para evitar conflicto con botón de Instagram */
@media (max-width: 768px) and (min-width: 481px) {
  #faqbot-toggle {
    bottom:20px; /* Más separación en tablets */
  }
}

@media (max-width: 480px) {
  #faqbot-toggle {
    bottom:15px; /* Posición optimizada para móviles pequeños */
    right:15px;
  }
}

/* Header responsive */
#faqbot header{
  display:flex; align-items:center; gap:10px; padding:12px 14px; background:linear-gradient(180deg, rgba(255,204,0,.14), transparent);
  border-bottom:1px solid #eef2ff;
}

@media (max-width: 480px) {
  #faqbot header {
    padding:10px 12px;
    gap:8px;
  }
}

#faqbot .dot{ width:10px; height:10px; border-radius:50%; background:var(--faqbot-accent); box-shadow:0 0 0 3px rgba(255,204,0,.25); }
#faqbot h3{ margin:0; font:800 16px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

@media (max-width: 480px) {
  #faqbot h3 { font-size:14px; }
}

#faqbot .sub{ font:400 12px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; opacity:.75 }
#faqbot .close{ margin-left:auto; background:transparent; border:none; font-size:18px; cursor:pointer; opacity:.6; padding:4px; }

/* Body y mensajes responsive */
#faqbot .body{ display:flex; flex-direction:column; gap:10px; padding:12px; }

@media (max-width: 480px) {
  #faqbot .body { padding:10px; gap:8px; }
}

#faqbot .log{ 
  overflow:auto; display:flex; flex-direction:column; gap:12px; padding:4px; 
  min-height:220px; max-height:380px; 
}

@media (max-width: 768px) {
  #faqbot .log { 
    min-height:180px; max-height:320px; 
    gap:10px;
  }
}

@media (max-width: 480px) {
  #faqbot .log { 
    min-height:160px; max-height:280px; 
    gap:8px; padding:2px;
  }
}

#faqbot .msg{ 
  border-radius:14px; padding:12px 14px; 
  font:450 15px/1.55 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; 
  white-space:pre-wrap; letter-spacing:.1px; 
  max-width:85%;
}

@media (max-width: 480px) {
  #faqbot .msg { 
    padding:10px 12px; 
    font-size:14px; 
    border-radius:12px;
    max-width:90%;
  }
}

#faqbot .me{ align-self:flex-end; background:#fff7cc; border:1px solid #f6e38a }
#faqbot .bot{ align-self:flex-start; background:#f8fafc; border:1px solid #e5e7eb }

/* Chips responsive */
#faqbot .chips{ display:flex; flex-wrap:wrap; gap:10px; }

@media (max-width: 480px) {
  #faqbot .chips { gap:6px; }
}

#faqbot .chip{ 
  border:1px dashed #d1d5db; padding:8px 12px; border-radius:999px; 
  font-size:12px; cursor:pointer; background:#fff; transition:all .15s;
  touch-action:manipulation; /* Mejora para dispositivos táctiles */
}

@media (max-width: 480px) {
  #faqbot .chip { 
    padding:6px 10px; 
    font-size:11px; 
  }
}

#faqbot .chip:hover, #faqbot .chip:active{ border-color:#111827; transform:translateY(-1px) }

/* Acciones responsive */
#faqbot .actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap }

@media (max-width: 480px) {
  #faqbot .actions { gap:6px; }
}

#faqbot .wa{ color:#10b981; font-weight:700; text-decoration:none }
#faqbot .cta{ 
  background:var(--faqbot-accent); color:#000; border:none; 
  padding:10px 14px; border-radius:12px; font-weight:800; cursor:pointer;
  touch-action:manipulation; /* Mejora para dispositivos táctiles */
}

@media (max-width: 480px) {
  #faqbot .cta { 
    padding:8px 12px; 
    font-size:13px; 
  }
}

/* Composer responsive */
#faqbot .composer{ display:flex; gap:8px; padding:12px; border-top:1px solid #e5e7eb; }

@media (max-width: 480px) {
  #faqbot .composer { 
    padding:10px; 
    gap:6px; 
  }
}

#faqbot textarea{ 
  flex:1; resize:none; min-height:42px; max-height:96px; 
  padding:12px; border:1px solid #e5e7eb; border-radius:12px; 
  font:400 14px system-ui;
  touch-action:manipulation; /* Mejora para dispositivos táctiles */
}

@media (max-width: 480px) {
  #faqbot textarea { 
    min-height:38px; max-height:80px; 
    padding:10px; 
    font-size:13px; 
  }
}

#faqbot button.send{ 
  background:var(--faqbot-accent); color:#000; border:none; 
  padding:10px 14px; border-radius:12px; font-weight:700; cursor:pointer;
  touch-action:manipulation; /* Mejora para dispositivos táctiles */
}

@media (max-width: 480px) {
  #faqbot button.send { 
    padding:8px 12px; 
    font-size:13px; 
  }
}

/* Modo oscuro responsive */
@media (prefers-color-scheme:dark){
  #faqbot{ background:var(--faqbot-dark); color:#e5e7eb; border-color:#0f172a }
  #faqbot .bot{ background:#101734; border-color:#1f2937 }
  #faqbot .me{ background:#1d1d1d; border-color:#2a2a2a }
  #faqbot .chip{ background:transparent; border-color:#2b3446; color:#d1d5db }
  #faqbot textarea{ background:#0b1020; color:#e5e7eb; border-color:#1f2937 }
  #faqbot button.send{ background:var(--faqbot-accent); color:#000 }
  #faqbot .cta{ background:var(--faqbot-accent); color:#000 }
}

/* Mejoras adicionales para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  #faqbot .chip:hover { transform:none; }
  #faqbot .chip:active { 
    transform:scale(0.95); 
    background:#f3f4f6; 
  }
  #faqbot .cta:active, #faqbot button.send:active {
    transform:scale(0.95);
  }
  
  /* Aumentar área táctil para elementos pequeños */
  #faqbot .close {
    padding:8px;
    min-width:32px;
    min-height:32px;
  }
  
  /* Mejorar feedback táctil */
  #faqbot-toggle:active {
    transform:scale(0.95);
  }
  
  /* Asegurar que los elementos sean fáciles de tocar */
  #faqbot .chip {
    min-height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  
  #faqbot .cta, #faqbot button.send {
    min-height:40px;
  }
}
