/* ============================
   RESET Y BASE
   ============================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: #F9FAFB;
  color: #1f2937;
  line-height: 1.6;
}

/* ============================
   LAYOUT LANDING
   ============================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, #0A3D5C 0%, #1E5F8C 100%);
  color: white;
  padding: 100px 20px;
  text-align: center;
  position: relative;
}

/* BOTÓN ENTRAR PARA CLIENTES REGISTRADOS */
.btn-entrar {
  position: absolute;
  top: 30px;
  right: 30px;
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  background: transparent;
  color: white;
  border: 3px solid white;
  z-index: 10;
}

.btn-entrar:hover {
  background: white;
  color: #0A3D5C;
}

@media (max-width: 768px) {
  .btn-entrar {
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    font-size: 16px;
    align: center;
  }
}

.hero-title {
  font-size: 56px;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(90deg, #F59E0B, #EF4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 20px;
  max-width: 700px;
  margin: 0 auto 40px;
  opacity: 0.95;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.btn {
  padding: 16px 40px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s;
  display: inline-block;
}

.btn-primary {
  background: white;
  color: #0A3D5C;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: #0A3D5C;
}

/* ========== SECCIONES ========== */
.section {
  padding: 80px 20px;
}

.section-title {
  text-align: center;
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 50px;
  color: #1f2937;
}

.subtitle {
  text-align: center;
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 50px;
}

/* ========== PROBLEMA ========== */
.problema {
  background: #f9fafb;
}

.problemas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.problema-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: transform 0.3s;
}

.problema-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.emoji {
  font-size: 48px;
  margin-bottom: 15px;
}

.problema-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.problema-card p {
  font-size: 14px;
  color: #6b7280;
}

/* ========== PUERTAS ========== */
.puertas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.puerta-card {
  background: #f9fafb;
  padding: 30px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  transition: all 0.3s;
  position: relative;
}

.puerta-card:hover {
  border-color: #0A3D5C;
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(10, 61, 92, 0.15);
}

.puerta-card.highlight {
  background: linear-gradient(135deg, #0A3D5C15, #1E5F8C15);
  border-color: #0A3D5C;
}

.puerta-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.puerta-card h3 {
  font-size: 22px;
  margin-bottom: 10px;
}

.puerta-card ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
}

.puerta-card li {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.puerta-card li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: bold;
}

.badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #F59E0B;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.coming-soon {
  display: inline-block;
  background: #FEF3C7;
  color: #F59E0B;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  margin-top: 8px;
}

/* ========== PRICING ========== */
.pricing {
  background: #f9fafb;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.pricing-card {
  background: white;
  padding: 40px 30px;
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  text-align: center;
  position: relative;
  transition: all 0.3s;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.pricing-card.featured {
  border-color: #0A3D5C;
  box-shadow: 0 5px 20px rgba(10, 61, 92, 0.2);
}

.popular-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0A3D5C, #1E5F8C);
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.price {
  margin: 20px 0;
}

.amount {
  font-size: 48px;
  font-weight: 800;
  color: #0A3D5C;
}

.period {
  font-size: 18px;
  color: #6b7280;
}

.features {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
  text-align: left;
}

.features li {
  padding: 10px 0;
  font-size: 14px;
  color: #4b5563;
  border-bottom: 1px solid #f3f4f6;
}

.btn-plan {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: 2px solid #0A3D5C;
  color: #0A3D5C;
  background: white;
}

.btn-plan:hover {
  background: #0A3D5C;
  color: white;
}

.btn-plan.primary {
  background: #0A3D5C;
  color: white;
}

/* ========== CTA FINAL ========== */
.cta-final {
  padding: 80px 20px;
  background: linear-gradient(135deg, #0A3D5C 0%, #1E5F8C 100%);
  color: white;
  text-align: center;
}

.cta-final h2 {
  font-size: 42px;
  margin-bottom: 15px;
}

.btn-cta {
  display: inline-block;
  background: white;
  color: #0A3D5C;
  padding: 18px 50px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s;
}

.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

/* ========== NUEVOS ESTILOS OFERTA ========== */
.discount-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #EF4444, #F59E0B);
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  z-index: 5;
  white-space: nowrap;
}

.original-price {
  text-decoration: line-through;
  color: #6b7280;
  font-size: 24px;
  margin-right: 10px;
}

.discount-text {
  color: #EF4444;
  font-weight: 700;
  font-size: 16px;
  margin-top: 5px;
}

.currency-selector {
  text-align: center;
  margin-bottom: 30px;
  padding: 15px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.currency-selector select {
  padding: 10px 15px;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  font-size: 16px;
  margin: 0 10px;
  background: white;
  cursor: pointer;
}

.price-note {
  font-size: 12px;
  color: #6b7280;
  margin-top: 5px;
  font-style: italic;
}

.tax-info {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
}

.iva-included {
  font-size: 12px;
  color: #10b981;
  font-weight: 600;
  margin-top: 5px;
}

/* ========== RESPONSIVE LANDING ========== */
@media (max-width: 768px) {
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 20px; color: orange; }
  .section-title { font-size: 32px; }
  .pricing-cards { grid-template-columns: 1fr; }
  .discount-badge {
    font-size: 12px;
    padding: 6px 15px;
  }
  .currency-selector {
    padding: 10px;
  }
  .currency-selector select {
    font-size: 14px;
    padding: 8px 12px;
  }
}

/* ============================
   CHAT PAGE (body.chat-page)
   ============================ */

body.chat-page {
  display: flex;
  flex-direction: column;
}

/* Header */
.chat-page .header {
  background: linear-gradient(135deg, #1E5F8C 0%, #0A3D5C 100%);
  color: white;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-page .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-page .logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Encabezados de respuesta IA */
.chat-page h1 {
  font-size: 2.5em;
  font-weight: bold;
  color: light-yellow;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
  margin-top: 20px;
  margin-bottom: 10px;
}

.chat-page h2 {
  font-size: 2em;
  font-weight: bold;
  color: white;
  margin-top: 18px;
  margin-bottom: 8px;
}

.chat-page h3 {
  font-size: 1.5em;
  font-weight: bold;
  color: white;
  margin-top: 15px;
  margin-bottom: 6px;
}

.chat-page h4 {
  font-size: 1.2em;
  font-weight: bold;
  color: white;
  margin-top: 12px;
  margin-bottom: 5px;
}

.chat-page strong {
  font-weight: bold;
  color: white;
}

.chat-page .header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-page .header-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  font-family: inherit;
}

.chat-page .header-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

/* Container principal */
.chat-page .main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Selección de puerta */
.chat-page .puerta-selection {
  padding: 30px 20px;
  overflow-y: auto;
  flex: 1;
}

.chat-page .puerta-selection h2 {
  color: #1F2937;
  font-size: 24px;
  margin-bottom: 10px;
}

.chat-page .puerta-selection p {
  color: #6B7280;
  margin-bottom: 24px;
}

.chat-page .puertas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.chat-page .puerta-card {
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.chat-page .puerta-card:hover {
  border-color: #1E5F8C;
  box-shadow: 0 4px 12px rgba(30, 95, 140, 0.1);
  transform: translateY(-2px);
}

.chat-page .puerta-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-page .puerta-card.disabled:hover {
  transform: none;
  border-color: #E5E7EB;
}

.chat-page .puerta-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.chat-page .puerta-title {
  font-size: 16px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 6px;
}

.chat-page .puerta-desc {
  font-size: 13px;
  color: #6B7280;
  line-height: 1.4;
}

.chat-page .coming-soon {
  display: inline-block;
  background: #FEF3C7;
  color: #F59E0B;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  margin-top: 8px;
}

.chat-page .destacado {
  display: inline-block;
  background: #ddf138;
  color: #F59E0B;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  margin-top: 8px;
}

/* Botón "Ver más" / info modal */
.chat-page .info-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #F3F4F6;
  color: #6B7280;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.chat-page .info-btn:hover {
  background: #1E5F8C;
  color: white;
}

.chat-page .puerta-card.disabled .info-btn {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Modal de información */
.chat-page .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.chat-page .modal-overlay.active {
  display: flex;
}

.chat-page .modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}

.chat-page .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.chat-page .modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1E5F8C;
  margin: 0;
  flex: 1;
  margin-right: 16px;
}

.chat-page .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6B7280;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-page .modal-close:hover {
  color: #374151;
}

.chat-page .modal-content {
  color: #4B5563;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-line;
}

/* Chat area */
.chat-page .chat-area {
  display: none;
  flex-direction: column;
  height: 100%;
}

.chat-page .chat-area.active {
  display: flex;
}

/* Messages container */
.chat-page .messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-page .messages-container::-webkit-scrollbar {
  width: 8px;
}

.chat-page .messages-container::-webkit-scrollbar-track {
  background: #F3F4F6;
}

.chat-page .messages-container::-webkit-scrollbar-thumb {
  background: #9CA3AF;
  border-radius: 4px;
}

.chat-page .messages-container::-webkit-scrollbar-thumb:hover {
  background: #6B7280;
}

.chat-page .message {
  display: flex;
  gap: 12px;
  max-width: 95%;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-page .message.estudiante {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-page .message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
  background: #F59E0B;
}

/* Avatar asistente */
.chat-page .message.asistente .message-avatar {
  background: #1E5F8C;
  color: white;
  font-weight: bold;
  border: none;
}

.chat-page .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-page .message.asistente .message-content {
  background: #1E5F8C;
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(30, 95, 140, 0.3);
  line-height: 1.5;
  font-size: 15px;
}

.chat-page .message.estudiante .message-avatar {
  background: #F3F4F6;
  color: #6B7280;
  border: 1px solid #E5E7EB;
}

.chat-page .message-content {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  line-height: 1.5;
  font-size: 15px;
  color: #1F2937;
  word-wrap: break-word;
}

.chat-page .message.estudiante .message-content {
  background: white;
  color: #1F2937;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #E5E7EB;
}

.chat-page .message-content img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
}

/* Typing indicator */
.chat-page .typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  width: fit-content;
}

.chat-page .typing-indicator.active {
  display: flex;
}

.chat-page .typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9CA3AF;
  animation: typing 1.4s infinite;
}

.chat-page .typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-page .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

/* Input area */
.chat-page .input-area {
  background: white;
  border-top: 1px solid #E5E7EB;
  padding: 16px 20px;
  flex-shrink: 0;
}

.chat-page .input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 800px;
  margin: 0 auto;
}

.chat-page .input-actions {
  display: flex;
  gap: 8px;
}

.chat-page .btn-icon {
  background: #F3F4F6;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-page .btn-icon:hover {
  background: #E5E7EB;
}

.chat-page .btn-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-page #messageInput {
  flex: 1;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  min-height: 40px;
}

.chat-page #messageInput:focus {
  outline: none;
  border-color: #1E5F8C;
}

.chat-page .btn-send {
  background: #1E5F8C;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-page .btn-send:hover:not(:disabled) {
  background: #0A3D5C;
}

.chat-page .btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-page #imageInput {
  display: none;
}

.chat-page .image-preview {
  display: none;
  margin-bottom: 12px;
  position: relative;
}

.chat-page .image-preview.active {
  display: block;
}

.chat-page .image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  border: 2px solid #E5E7EB;
}

.chat-page .image-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #EF4444;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Responsive chat */
@media (max-width: 768px) {
  .chat-page .messages-container {
    padding: 15px;
  }

  .chat-page .message {
    max-width: 90%;
  }

  .chat-page .input-area {
    padding: 12px 15px;
  }

  .chat-page .header-actions {
    flex-direction: column;
    gap: 8px;
  }

  .chat-page .header-btn {
    font-size: 12px;
    padding: 6px 10px;
  }

  .chat-page .modal {
    margin: 20px;
    padding: 20px;
  }
}
