/* ============================
   KORU DEV - BRANDING GLOBAL
   Paleta:
   - Ocean Deep: #1E5F8C (principal)
   - Renewal Green: #55C7A5 (secundario)
   - Path Gold: #F5C657 (acento)
   - Graphite: #2A2D34
   - Coral Accent: #FF8866
   - Blanco: #FFFFFF
   ============================ */

:root {
  --koru-ocean: #1E5F8C;
  --koru-ocean-dark: #155377;
  --koru-green: #55C7A5;
  --koru-gold: #F5C657;
  --koru-graphite: #2A2D34;
  --koru-text-main: #1F2937;
  --koru-text-muted: #6B7280;
  --koru-bg-light: #F9FAFB;
  --koru-border-soft: #E5E7EB;
  --koru-coral: #FF8866;
  --koru-lavender: #A98CF0;
}

/* ============================
   RESET Y BASE
   ============================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: var(--koru-bg-light);
  color: var(--koru-text-main);
  line-height: 1.6;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Tipografías por jerarquía */
h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================
   LAYOUT LANDING
   ============================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, var(--koru-ocean) 0%, var(--koru-green) 100%);
  color: white;
  padding: 100px 20px 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* BOTÓN ENTRAR DEV */
.btn-entrar {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 10px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s ease;
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.85);
  z-index: 10;
}

.btn-entrar:hover {
  background: white;
  color: var(--koru-ocean-dark);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
  .btn-entrar {
    top: 16px;
    right: 16px;
    padding: 8px 18px;
    font-size: 13px;
  }
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-title span.gradient-text {
  background: linear-gradient(90deg, var(--koru-gold), var(--koru-coral));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  max-width: 720px;
  margin: 0 auto 32px;
  opacity: 0.96;
}

.hero-badge-dev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn {
  padding: 14px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--koru-green);
  color: var(--koru-graphite);
  border-color: var(--koru-green);
}

.btn-primary:hover {
  background: #41b495;
  border-color: #41b495;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.btn-secondary {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.9);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

/* ========== SECCIONES ========== */
.section {
  padding: 80px 20px;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--koru-graphite);
}

.subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--koru-text-muted);
  margin-bottom: 40px;
}

/* ========== PROBLEMA ========== */
.problema {
  background: var(--koru-bg-light);
}

.problemas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.problema-card {
  background: white;
  padding: 26px 22px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  border: 1px solid rgba(148,163,184,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.problema-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(15,23,42,0.12);
}

.emoji {
  font-size: 40px;
  margin-bottom: 12px;
}

.problema-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--koru-graphite);
}

.problema-card p {
  font-size: 14px;
  color: var(--koru-text-muted);
}

/* ========== PUERTAS ========== */
.puertas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

.puerta-card {
  background: white;
  padding: 26px 22px;
  border-radius: 16px;
  border: 1px solid var(--koru-border-soft);
  transition: all 0.25s ease;
  position: relative;
}

.puerta-card:hover {
  border-color: var(--koru-ocean);
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(30,95,140,0.14);
}

.puerta-card.highlight {
  background: linear-gradient(135deg, rgba(30,95,140,0.04), rgba(85,199,165,0.05));
  border-color: rgba(30,95,140,0.65);
}

.puerta-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.puerta-card h3 {
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--koru-graphite);
}

.puerta-card p {
  font-size: 14px;
  color: var(--koru-text-muted);
}

.puerta-card ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
}

.puerta-card li {
  font-size: 13px;
  color: #4B5563;
  margin-bottom: 6px;
  padding-left: 20px;
  position: relative;
}

.puerta-card li::before {
  content: "•";
  position: absolute;
  left: 8px;
  top: 1px;
  color: var(--koru-green);
}

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--koru-gold);
  color: var(--koru-graphite);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.coming-soon {
  display: inline-block;
  background: rgba(169,140,240,0.16);
  color: var(--koru-lavender);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 999px;
  margin-top: 8px;
}

/* ========== PRICING ========== */
.pricing {
  background: var(--koru-bg-light);
}

.currency-selector {
  text-align: center;
  margin-bottom: 30px;
  padding: 14px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(15,23,42,0.05);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.currency-selector span {
  font-size: 14px;
  color: var(--koru-text-muted);
}

.currency-selector select {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--koru-border-soft);
  font-size: 14px;
  margin: 0 8px;
  background: white;
  cursor: pointer;
}

.price-note {
  font-size: 12px;
  color: var(--koru-text-muted);
  margin-top: 6px;
  font-style: italic;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  max-width: 820px;
  margin: 0 auto;
}

.pricing-card {
  background: white;
  padding: 32px 26px;
  border-radius: 18px;
  border: 1px solid var(--koru-border-soft);
  text-align: center;
  position: relative;
  transition: all 0.25s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(15,23,42,0.12);
}

.pricing-card.featured {
  border-color: var(--koru-ocean);
  box-shadow: 0 12px 32px rgba(30,95,140,0.35);
  background: radial-gradient(circle at top left, rgba(85,199,165,0.12), white 55%);
}

.popular-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--koru-ocean), var(--koru-green));
  color: white;
  padding: 7px 20px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.discount-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, var(--koru-coral), var(--koru-gold));
  color: white;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  z-index: 5;
}

.price {
  margin: 18px 0 8px;
}

.amount {
  font-size: 40px;
  font-weight: 800;
  color: var(--koru-ocean);
}

.original-price {
  text-decoration: line-through;
  color: var(--koru-text-muted);
  font-size: 20px;
  margin-right: 6px;
}

.period {
  font-size: 16px;
  color: var(--koru-text-muted);
}

.discount-text {
  color: var(--koru-coral);
  font-weight: 700;
  font-size: 14px;
  margin-top: 4px;
}

.features {
  list-style: none;
  padding: 0;
  margin: 20px 0 26px 0;
  text-align: left;
}

.features li {
  padding: 7px 0;
  font-size: 14px;
  color: #4B5563;
  border-bottom: 1px solid #F3F4F6;
}

.btn-plan {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
  border: 2px solid var(--koru-ocean);
  color: var(--koru-ocean);
  background: white;
}

.btn-plan:hover {
  background: var(--koru-ocean);
  color: white;
}

.btn-plan.primary {
  background: var(--koru-ocean);
  color: white;
}

.btn-plan.primary:hover {
  background: var(--koru-ocean-dark);
}

/* ========== CTA FINAL ========== */
.cta-final {
  padding: 70px 20px 80px;
  background: linear-gradient(135deg, var(--koru-ocean), var(--koru-green));
  color: white;
  text-align: center;
}

.cta-final h2 {
  font-size: 34px;
  margin-bottom: 10px;
}

.btn-cta {
  display: inline-flex;
  background: var(--koru-green);
  color: var(--koru-graphite);
  padding: 14px 40px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.25s ease;
  border: 2px solid transparent;
}

.btn-cta:hover {
  background: #41b495;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
}

/* ========== RESPONSIVE LANDING ========== */
@media (max-width: 768px) {
  .hero {
    padding-top: 90px;
  }
  .hero-title {
    font-size: 32px;
  }
  .hero-subtitle {
    font-size: 15px;
  }
  .section-title {
    font-size: 28px;
  }
  .pricing-cards {
    grid-template-columns: 1fr;
  }
}

/* ============================
   CHAT PAGE (body.chat-page)
   ============================ */

body.chat-page {
  display: flex;
  flex-direction: column;
}

/* Header chat */
.chat-page .header {
  background: linear-gradient(135deg, var(--koru-ocean), var(--koru-green));
  color: white;
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-page .header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-page .logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Encabezados respuesta IA dentro de mensajes HTML */
.chat-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--koru-gold);
  border-bottom: 1px solid rgba(249,250,251,0.3);
  padding-bottom: 4px;
  margin-top: 12px;
  margin-bottom: 6px;
}

.chat-page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #F9FAFB;
  margin-top: 10px;
  margin-bottom: 4px;
}

.chat-page h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #E5E7EB;
  margin-top: 8px;
  margin-bottom: 4px;
}

.chat-page h4 {
  font-size: 0.98rem;
  font-weight: 600;
  color: #E5E7EB;
  margin-top: 6px;
  margin-bottom: 2px;
}

.chat-page strong {
  font-weight: 700;
  color: #FFFFFF;
}

.chat-page .header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-page .header-btn {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  font-family: inherit;
}

.chat-page .header-btn:hover {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.6);
}

/* Container principal */
.chat-page .main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Selección de puerta */
.chat-page .puerta-selection {
  padding: 24px 18px;
  overflow-y: auto;
  flex: 1;
}

/* Cards en la selección de puerta se heredan de arriba,
   pero aquí afinamos detalle de layout */
.chat-page .puertas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  max-width: 860px;
  margin: 0 auto;
}

/* Modal de información */
.chat-page .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  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: 14px;
  padding: 22px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 16px 35px rgba(15,23,42,0.4);
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}

.chat-page .modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--koru-ocean);
}

.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: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #0F172A;
}

.chat-page .messages-container::-webkit-scrollbar {
  width: 8px;
}

.chat-page .messages-container::-webkit-scrollbar-track {
  background: #020617;
}

.chat-page .messages-container::-webkit-scrollbar-thumb {
  background: #64748B;
  border-radius: 4px;
}

.chat-page .message {
  display: flex;
  gap: 10px;
  max-width: 96%;
  animation: fadeIn 0.25s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-page .message.estudiante {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-page .message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--koru-gold);
}

/* Avatar asistente */
.chat-page .message.asistente .message-avatar {
  background: var(--koru-ocean);
  color: white;
  border: none;
}

.chat-page .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Burbujas */
.chat-page .message.asistente .message-content {
  background: linear-gradient(135deg, var(--koru-ocean), #0F172A);
  color: #F9FAFB;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(15,23,42,0.5);
  line-height: 1.5;
  font-size: 14px;
}

.chat-page .message.estudiante .message-avatar {
  background: #111827;
  color: #E5E7EB;
  border: 1px solid #1F2937;
}

.chat-page .message-content {
  background: #020617;
  padding: 9px 13px;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.45);
  line-height: 1.5;
  font-size: 14px;
  color: #E5E7EB;
  border: 1px solid #1E293B;
}

.chat-page .message.estudiante .message-content {
  background: #020617;
  border-color: #334155;
}

.chat-page .message-content img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 6px;
}

/* Typing indicator */
.chat-page .typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #020617;
  border-radius: 999px;
}

.chat-page .typing-indicator.active {
  display: flex;
}

.chat-page .typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9CA3AF;
  animation: typing 1.3s infinite;
}

.chat-page .typing-dot:nth-child(2) { animation-delay: 0.18s; }
.chat-page .typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Input area */
.chat-page .input-area {
  background: #020617;
  border-top: 1px solid #1E293B;
  padding: 10px 14px;
  flex-shrink: 0;
}

.chat-page .input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 860px;
  margin: 0 auto;
}

.chat-page .input-actions {
  display: flex;
  gap: 6px;
}

.chat-page .btn-icon {
  background: #0B1120;
  border: 1px solid #1F2937;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.18s ease;
  flex-shrink: 0;
  color: #E5E7EB;
}

.chat-page .btn-icon:hover {
  background: #111827;
  border-color: #334155;
}

.chat-page .btn-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-page #messageInput {
  flex: 1;
  border: 1px solid #1E293B;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  min-height: 38px;
  background: #020617;
  color: #E5E7EB;
}

.chat-page #messageInput::placeholder {
  color: #6B7280;
}

.chat-page #messageInput:focus {
  outline: none;
  border-color: var(--koru-green);
}

.chat-page .btn-send {
  background: var(--koru-green);
  border: none;
  color: var(--koru-graphite);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.chat-page .btn-send:hover:not(:disabled) {
  background: #41b495;
}

.chat-page .btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-page #imageInput {
  display: none;
}

.chat-page .image-preview {
  display: none;
  margin-bottom: 8px;
  position: relative;
}

.chat-page .image-preview.active {
  display: block;
}

.chat-page .image-preview img {
  max-width: 180px;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid #1E293B;
}

.chat-page .image-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--koru-coral);
  color: white;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Responsive chat */
@media (max-width: 768px) {
  .chat-page .messages-container {
    padding: 10px;
  }
  .chat-page .message {
    max-width: 92%;
  }
  .chat-page .input-area {
    padding: 8px 10px;
  }
  .chat-page .header-actions {
    flex-direction: column;
    gap: 6px;
  }
}
