* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: transparent;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1f1f1f;
}

/* ========== FONDO ANIMADO AURORA BOREAL ========== */
body::before {
  content: "";
  position: fixed;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
 background: 
    /* 1. Índigo profundo (esencia Gemini) - Zona superior izquierda */
    radial-gradient(ellipse at 15% 20%, rgba(79, 70, 229, 0.45) 0%, transparent 30%),
    
    /* 2. Cian/Teal frío (toque tecnológico) - Zona superior derecha */
    radial-gradient(ellipse at 85% 15%, rgba(6, 182, 212, 0.30) 0%, transparent 60%),
    
    /* 3. Cobre/Bronce terroso (inspiración The Book) - Zona inferior central */
    radial-gradient(ellipse at 15% 20%, rgba(234, 88, 12, 0.3) 0%, transparent 60%),
    
    /* 4. Violeta oscuro (Gemini) - Zona inferior derecha */
    radial-gradient(ellipse at 75% 75%, rgba(91, 33, 182, 0.50) 0%, transparent 15%);
    background-size: 150% 150%;
    
filter: blur(60px);
  z-index: -1;
  animation: auroraDrift 6s ease-in-out infinite alternate;
}


@keyframes auroraDrift {
    0% {
        background-position: 0% 0%;
        transform: scale(1) rotate(0deg);
    }
    25% {
        background-position: 40% 20%;
        transform: scale(1.04) rotate(1.5deg);
    }
    50% {
        background-position: 10% 60%;
        transform: scale(0.96) rotate(-1.2deg);
    }
    75% {
        background-position: 60% 10%;
        transform: scale(1.02) rotate(0.8deg);
    }
    100% {
        background-position: 30% 70%;
        transform: scale(1) rotate(-0.5deg);
    }
}

/* ========== LOGIN SCREEN ========== */
.login-screen {
  background: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px;
  position: relative;
  z-index: 1;
}

/* Tarjetas blancas */
.white-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  padding: 48px 32px 32px;  /* Aumentado el padding superior */
  margin-bottom: 32px;
  max-width: 700px;
  width: 100%;
  transition: transform 0.2s;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo h1 {
  font-size: 48px;
  font-weight: 500;
  color: #1f1f1f;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.tagline {
  font-size: 16px;
  font-weight: 400;
  color: #4a4458;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
  background: linear-gradient(90deg, #c084fc, #f472b6, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Formulario de login */
.login-form {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 32px;
  background: white;
  padding: 32px 28px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
  border: 1px solid #f0e6f6;
}

.login-form .email-input,
.login-form .name-input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border 0.2s, background 0.2s;
  background: white;
  margin-bottom: 16px;
}

.login-form .email-input:focus,
.login-form .name-input:focus {
  border-color: #f4b400;
}

.login-form .email-btn {
  width: 100%;
  padding: 14px;
  background: #1f1f1f;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-bottom: 16px;
}

.login-form .email-btn:hover { background: #333; }
.login-form .email-btn:active { transform: scale(0.98); }
.login-form .email-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.error { color: #d93025; font-size: 13px; margin-bottom: 12px; }

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #5f6368;
  margin-bottom: 24px;
  line-height: 1.5;
}

.terms-check input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #1f1f1f;
}

.terms-check a {
  color: #1f1f1f;
  text-decoration: underline;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

/* Demo typewriter */
.demo-section {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 48px;
  padding-top: 30px;
  padding-bottom: 30px;
  text-align: center;
}

.demo-section h2 {
  font-size: 24px;
  font-weight: 500;
  color: #1f1f1f;
  margin-bottom: 20px;
}

.phone-frame {
  background: #fff;
  border-radius: 36px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  padding: 16px 16px 20px;
  max-width: 340px;
  margin: 0 auto;
  border: 1px solid #f0e6f6;
}

.phone-notch {
  width: 100px;
  height: 5px;
  background: #e0e0e0;
  border-radius: 3px;
  margin: 0 auto 14px;
}

.demo-input-container {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 10px 14px;
  height: 60px;
  display: flex;
  align-items: center;
}

.demo-input {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #1f1f1f;
  display: flex;
  align-items: baseline;
  width: 100%;
}

.demo-text {
  white-space: nowrap;
  overflow: hidden;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, #c084fc, #f472b6);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

/* Why section */
.why-section {
  max-width: 700px;
  margin: 0 auto 64px;
  padding: 0 20px;
  padding-top: 30px;
  padding-bottom: 30px;
  text-align: center;
}

.why-section h2 {
  font-size: 24px;
  font-weight: 500;
  color: #1f1f1f;
  margin-bottom: 16px;
}

.why-section p {
  font-size: 16px;
  line-height: 1.6;
  color: #4a4458;
  max-width: 550px;
  margin: 0 auto 24px;
}

.why-benefits {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.benefit-item {
  background: white;
  border: 1px solid #f0e6f6;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #5f6368;
  min-width: 150px;
  flex: 1 1 200px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.benefit-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.benefit-icon {
  font-size: 28px;
  background: linear-gradient(135deg, #c084fc, #f472b6, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* FAQ */
.faq-section {
  max-width: 700px;
  margin: 0 auto 80px;
  padding: 0 20px;
  padding-top: 30px;
  padding-bottom: 30px;
  text-align: left;
}

.faq-section h2 {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 24px;
  text-align: center;
  color: #1f1f1f;
}

.faq-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 18px 0;
}

.faq-question {
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}

.faq-question::after {
  content: '+';
  font-size: 20px;
  transition: transform 0.2s;
}

.faq-question.open::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: #5f6368;
  font-size: 14px;
  line-height: 1.6;
}

.faq-answer.open {
  max-height: 300px;
  padding-top: 12px;
}

/* ========== COOKIE BANNER ========== */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  color: black;
  z-index: 3000;
  padding: 16px 20px; /* reducimos un poco el padding horizontal */
  display: flex;
  justify-content: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1); /* opcional para separación */
}

.cookie-content {
  max-width: 800px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* permite que los elementos se envuelvan */
  text-align: center;
}

.cookie-content p {
  flex: 1 1 auto; /* permite que el texto ocupe el espacio disponible */
  font-size: 14px; /* un poco más grande para legibilidad */
  line-height: 1.5;
  margin: 0;
  /* eliminamos white-space: nowrap */
}

.cookie-content a {
  color: #f4b400;
  text-decoration: underline;
}

.cookie-content button {
  background: #f4b400;
  color: #000;
  border: none;
  padding: 10px 24px; /* un poco más de padding para mejor toque */
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0; /* evita que el botón se encoja */
}

/* Ajustes para móvil */
@media (max-width: 600px) {
  .cookie-content {
    flex-direction: column; /* apila verticalmente */
    gap: 12px;
  }
  .cookie-content p {
    font-size: 13px;
    text-align: center;
  }
  #cookie-banner {
    padding: 12px 16px;
  }
}

/* ========== CHAT PRINCIPAL ========== */
#guider-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 100%;
  background: white;
  margin: 0 auto;
  overflow: hidden;
}

.guider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #e8eaed;
  background: white;
  flex-shrink: 0;
}

.guider-header h2 { font-size: 20px; font-weight: 500; color: #1f1f1f; }

.guider-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 20px;
  background: #e8e8e8;
  color: #444;
}

.guider-badge.premium { background: #e6f4ea; color: #137333; }

.guider-suggestions {
  padding: 16px 24px 8px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  border-bottom: 1px solid #f1f3f4;
  background: white;
  flex-shrink: 0;
}

.guider-suggestions span {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid #dadce0;
  border-radius: 20px;
  font-size: 13px;
  color: #1f1f1f;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.guider-suggestions span:hover { background: #f4b400; border-color: #f4b400; color: #000; }

.guider-chat {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background: #f8f9fa;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.guider-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: #5f6368;
}

.guider-empty h1 { font-size: 32px; font-weight: 400; color: #1f1f1f; margin-bottom: 12px; }
.guider-empty p { font-size: 16px; line-height: 1.6; max-width: 500px; }

.msg { margin: 16px 0; display: flex; flex-direction: column; max-width: 80%; animation: fadeIn 0.3s ease; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; align-items: flex-start; }

.bubble {
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 15px;
  word-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.msg.user .bubble { background: #1f1f1f; color: white; border-bottom-right-radius: 4px; }
.msg.assistant .bubble { background: white; color: #1f1f1f; border-bottom-left-radius: 4px; }

.option-bubble {
  background: #f0f0f0 !important;
  border: 1px solid #dadce0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-size: 14px;
  padding: 10px 16px;
  text-align: left;
  width: 100%;
  display: block;
  color: #1f1f1f;
  font-family: inherit;
  border-radius: 12px;
  margin: 4px 0;
}
.option-bubble:hover { background: #f4b400 !important; border-color: #f4b400; color: #000; }

.time { font-size: 10px; color: #5f6368; margin-top: 4px; padding: 0 4px; }

.typing-dots { display: flex; gap: 4px; padding: 8px 0; }
.typing-dots span { width: 8px; height: 8px; background: #5f6368; border-radius: 50%; animation: bounce 1.4s infinite both; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.4); }
  40% { transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.guider-input-area {
  padding: 16px 24px;
  border-top: 1px solid #e8eaed;
  background: white;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.guider-input-area textarea {
  flex: 1;
  resize: none;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  transition: border 0.2s, background 0.2s;
  max-height: 120px;
  background: #f8f9fa;
}
.guider-input-area textarea:focus { border-color: #f4b400; background: white; }

.guider-input-area button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f4b400;
  color: #000;
  border: none;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guider-input-area button:hover { background: #e0a800; }
.guider-input-area button:active { transform: scale(0.95); }
.guider-input-area button:disabled { opacity: 0.5; cursor: not-allowed; }

.upgrade-banner {
  padding: 14px 24px;
  text-align: center;
  font-size: 14px;
  background: #fff8e1;
  border-top: 1px solid #ffe082;
  color: #333;
}
.upgrade-banner a { color: #f4b400; font-weight: 600; text-decoration: none; }

.clear-btn {
  background: none;
  border: 1px solid #dadce0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: #5f6368;
  transition: all 0.2s;
  font-family: inherit;
}
.clear-btn:hover { background: #f0f0f0; color: #1f1f1f; }

.account-badge-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.account-badge-btn:hover .guider-badge { opacity: 0.8; }

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin: 8px 0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #f4b400;
  border-radius: 4px;
  transition: width 0.3s;
}

/* Responsive */
@media (max-width: 600px) {
  .login-logo h1 { font-size: 36px; }
  .tagline { font-size: 14px; }
  .login-form { padding: 24px 20px; }
  .guider-header h2 { font-size: 18px; }
  .guider-suggestions { padding: 12px 16px; }
  .guider-suggestions span { font-size: 12px; padding: 6px 12px; }
  .guider-chat { padding: 16px; }
  .guider-input-area { padding: 12px 16px; }
  .bubble { font-size: 14px; }
  .msg { max-width: 90%; }
  .account-overlay { width: 100%; max-width: 100vw; }
}

/* Detalle de libro */
.detail-bubble { display: flow-root; margin: -6px 0; }
.detail-bubble .book-cover {
  width: 80px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-right: 12px;
  margin-top: 3px;
  margin-bottom: 0px;
  float: left;
}
.detail-bubble .detail-text { min-width: 0; }

/* Colecciones */
.collection-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.collection-item span { flex: 1; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-back { margin-bottom: 12px; background: #f0f0f0; color: #1f1f1f; }
.collection-book-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.collection-book-cover { width: 40px; height: auto; border-radius: 4px; }
.collection-book-info { flex: 1; }

/* Popups */
.popup {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: white; padding: 24px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 1002; max-width: 350px; width: 90%;
}
.popup h3 { margin-bottom: 16px; }
.popup-item { padding: 10px; border-bottom: 1px solid #eee; cursor: pointer; }
.popup-item:hover { background: #f8f8f8; }

.amazon-btn {
  display: inline-block; margin-top: 8px; padding: 4px 14px; font-size: 12px;
  background: #f4b400; color: #000 !important; border: none; border-radius: 20px;
  cursor: pointer; font-family: inherit; font-weight: 500; text-decoration: none !important;
}
.amazon-btn:hover { background: #e0a800; color: #000 !important; text-decoration: none !important; }

.collection-btn {
  display: inline-block; margin-top: 8px; padding: 4px 14px; font-size: 12px;
  background: #f0f0f0; color: #5f6368; border: 1px solid #dadce0; border-radius: 16px;
  cursor: pointer; font-family: inherit; font-weight: 500;
}
.collection-btn:hover { background: #e0e0e0; color: #1f1f1f; }

/* Overlays */
.overlay-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3); z-index: 999; display: none;
}
.overlay-backdrop.active { display: block; }

.account-overlay {
  position: fixed; top: 0; right: 0; width: 380px; max-width: 90vw;
  height: 100dvh; background: white; box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 1000; transform: translateX(100%); transition: transform 0.3s ease;
  overflow-y: auto; padding: 30px 24px; font-family: inherit;
}
.account-overlay.open { transform: translateX(0); }

.close-btn {
  position: absolute; top: 16px; right: 16px; background: none; border: none;
  font-size: 24px; cursor: pointer; color: #5f6368; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.close-btn:hover { background: #f0f0f0; }

.account-section { margin-bottom: 24px; }
.account-section h3 { font-size: 18px; font-weight: 500; margin-bottom: 16px; color: #1f1f1f; }

.account-field { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.account-field .label { color: #5f6368; }
.account-field .value { font-weight: 500; }

.plan-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.plan-badge.free { background: #e8e8e8; color: #444; }
.plan-badge.plus { background: #e6f4ea; color: #137333; }

.btn { display: inline-block; padding: 10px 20px; border-radius: 20px; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; border: none; transition: background 0.2s, color 0.2s; }
.btn-upgrade { background: #f4b400; color: #000; }
.btn-upgrade:hover { background: #e0a800; }
.btn-cancel { background: #d93025; color: white; }
.btn-cancel:hover { background: #c62828; }
.btn-logout { background: #f0f0f0; color: #1f1f1f; margin-top: 16px; width: 100%; }
.btn-logout:hover { background: #e0e0e0; }
.btn-support { background: #1f1f1f; color: white; width: 100%; text-align: center; }
.btn-support:hover { background: #333; }

/* Soporte */
.support-overlay { display: flex; flex-direction: column; overflow: hidden; padding: 20px 20px 12px; }
.support-overlay h3 { margin-bottom: 12px; flex-shrink: 0; }
.support-messages { flex: 1 1 auto; overflow-y: auto; padding: 8px 0; background: #f8f9fa; border-radius: 8px; margin-bottom: 12px; min-height: 0; font-size: 14px; }
.support-msg { margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; max-width: 85%; line-height: 1.4; clear: both; }
.support-msg.msg-bot { background: #fff; border: 1px solid #eee; float: left; }
.support-msg.msg-user { background: #1f1f1f; color: white; float: right; }
.support-input { display: flex; gap: 8px; flex-shrink: 0; }
.support-input input { flex: 1; padding: 10px 14px; border: 1px solid #e0e0e0; border-radius: 20px; font-size: 14px; outline: none; }
.support-input button { background: #f4b400; color: #000; border: none; border-radius: 20px; padding: 10px 18px; font-weight: 600; cursor: pointer; }

/* Loading shimmer */
.loading-message {
  font-size: 13px; font-weight: 500; margin-top: 8px; text-align: center;
  color: transparent;
  background: linear-gradient(90deg, #c084fc, #f472b6, #fbbf24, #c084fc);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 2.5s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
