/* ==============================
   ESTILOS GLOBALES PARA TODA LA WEB
============================== */

/* ==============================
   BODY Y CONTENEDORES
============================== */
html, body {
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f6fa;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* garantiza altura completa */
}

body > .container {
  max-width: 900px;
  margin: 50px auto;
  padding: 25px 30px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  flex: 1; /* ocupa el espacio disponible */
}

/* ==============================
   TITULOS
============================== */
h1 {
  color: #0d4f8b;
  text-align: center;
  font-size: 32px;
  margin-bottom: 30px;
}

h2 {
  color: #1e40af;
  font-size: 22px;
  margin-top: 25px;
  margin-bottom: 15px;
  border-bottom: 2px solid #e0e4f1;
  padding-bottom: 5px;
}

h3 {
  color: #1e3a8a;
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 10px;
}

/* ==============================
   PÁRRAFOS Y LISTAS
============================== */
p {
  margin-bottom: 18px;
  line-height: 1.7;
}

ul {
  margin-left: 20px;
  margin-bottom: 18px;
  line-height: 1.7;
}

/* ==============================
   ENLACES
============================== */
a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==============================
   BOTONES
============================== */
button, .btn {
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #0d4f8b;
  color: #fff;
  font-size: 14px;
  transition: background 0.2s;
}

button:hover, .btn:hover {
  background: #09407a;
}

/* ==============================
   INPUTS Y SELECTS
============================== */
input, select, textarea {
  width: 100%;
  padding: 8px;
  margin: 5px 0 12px 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  box-sizing: border-box;
}

/* ==============================
   TARJETAS DE SECCION
============================== */
.section-card {
  background: #f9faff;
  border-left: 5px solid #1e3a8a;
  padding: 20px 25px;
  margin-bottom: 25px;
  border-radius: 8px;
}

/* ==============================
   TARJETAS DE RESULTADOS (SIMULADOR)
============================== */
.cards {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 15px;
}

.card {
  flex: 1;
  min-width: 100px;
  padding: 10px;
  font-size: 13px;
  text-align: center;
  color: #555;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

/* ==============================
   FORMULARIOS
============================== */
.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#leadForm {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
}

#leadForm label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 14px;
}

#leadForm input[type="text"],
#leadForm input[type="email"],
#leadForm input[type="tel"] {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

/* ==============================
   TABLA DE AMORTIZACION
============================== */
..tabla-amortizacion {
  width: 100%;
  min-width: 400px;      /* asegura que la tabla no se haga demasiado estrecha */
  border-collapse: collapse;
  font-size: 14px;
}

.tabla-amortizacion th,
.tabla-amortizacion td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;   /* evita que los números se rompan en varias líneas */
}

.tabla-amortizacion th {
  background: #f1f3f6;
  text-align: center;
}

.tabla-amortizacion tbody tr:nth-child(even) {
  background: #f9fafb;
}

#tablaContainer {
  overflow-x: auto;       /* scroll horizontal si la tabla es más ancha que el contenedor */
  overflow-y: hidden;     /* opcional: no queremos scroll vertical si la altura está bien */
  margin-top: 15px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px;
  background-color: #f9fafb;
   
  max-width: 100%;       /* nunca exceda el ancho de la pantalla */ 
}
/* Contenedor centrado */
.btn-container {
  display: flex;
  justify-content: center;
  margin: 25px 0;
}

/* Botón moderno */
#verTabla {
  padding: 12px 24px;
  font-size: 16px;
  background-color: #0d4f8b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

#verTabla:hover {
  background-color: #09407a;
  transform: scale(1.05);
}

/* Animación de despliegue */
#tablaContainer {
  overflow: hidden;
  transition: max-height 0.5s ease;
}
/* ==============================
   FOOTER
============================== */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: #555;
  margin-top: auto; /* fuerza que el footer quede abajo */
  border-top: 1px solid #ddd;
}

/* ==============================
   BANNER DE COOKIES
============================== */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(51,51,51,0.95);
  color: #fff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  font-size: 13px;
  flex-wrap: wrap;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
}

#cookie-banner p {
  margin: 0;
  flex: 1;
}

#cookie-banner a {
  color: #ffd700;
  text-decoration: underline;
}

#cookie-banner button {
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 13px;
}

#btnAceptarCookies {
  background-color: #ffd700;
  color: #000;
}

#btnAceptarCookies:hover {
  background-color: #e6c200;
}

#btnRechazarCookies {
  background-color: #888;
  color: #fff;
  padding: 4px 8px;
}

#btnRechazarCookies:hover {
  background-color: #666;
}

/* ==============================
   BOTÓN FLOTANTE FAQ
============================== */
#faqButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: #0d4f8b;
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 50px;
  font-weight: bold;
  font-size: 24px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: background 0.2s, transform 0.2s;
  z-index: 1000;
}

#faqButton:hover {
  background-color: #09407a;
  transform: scale(1.2);
}

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 600px) {
  .cards .card {
    flex: 0 0 45%;
  }

  body > .container {
    margin: 20px;
    padding: 20px;
  }

  #cookie-banner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  #cookie-banner button {
    width: auto;
  }

   /* ==============================
   HERO BOTONES ORDENADOS
============================== */
.hero-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-buttons .btn {
  min-width: 150px;
  padding: 12px 20px;
  font-size: 16px;
  transition: background 0.2s, transform 0.2s;
}

.hero-buttons .btn:hover {
  background-color: #09407a;
  transform: scale(1.05);
}

/* ==============================
   FAQ - Contenedor y Búsqueda
============================== */
.faq-container {
  max-width: 800px;
  margin: auto;
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.faq-container h1 {
  text-align: center;
  color: #0d4f8b;
  margin-bottom: 20px;
}

#faqSearch {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

/* ==============================
   FAQ - Items y Acordeón
============================== */
.faq-item {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 0;
}

.faq-question {
  font-weight: bold;
  cursor: pointer;
  position: relative;
  padding-right: 25px;
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 0;
  font-weight: bold;
  font-size: 20px;
  transition: transform 0.2s;
}

.faq-answer {
  display: none;
  margin-top: 8px;
  color: #555;
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-item.active .faq-question::after {
  content: '-';
  transform: rotate(0deg);
}

/* ==============================
   RESPONSIVE FAQ
============================== */
@media (max-width: 600px) {
  .faq-container {
    padding: 20px;
  }
  .hero-buttons .btn {
    min-width: 120px;
    font-size: 14px;
  }

   /* ==============================
   BLOQUE OPERACIONES (PRE-ANÁLISIS)
============================== */

.operaciones-section {
  margin-top: 40px;
}

.operaciones-section h2 {
  text-align: center;
  color: #1e40af;
}

.operaciones-sub {
  text-align: center;
  color: #6b7280;
  margin-bottom: 25px;
}

.operacion-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  margin-bottom: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.operacion-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.card-header {
  padding: 18px;
  font-weight: 600;
  font-size: 16px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-content {
  max-height: 0;
  overflow-y: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.card-content.open {
  max-height: 800px; /* suficiente para todo el contenido */
  overflow-y: auto;  /* scroll si excede */
  padding: 20px 18px;
}
   
.card-content h4 {
  margin-top: 10px;
  font-size: 14px;
  color: #1e3a8a;
}

.card-content ul,
.card-content ol {
  margin-left: 18px;
}

.card-content button {
  margin-top: 15px;
  width: 100%;
  font-size: 14px;
  background-color: #0d4f8b;
  color: #fff;
  border-radius: 6px;
  padding: 10px;
}

.card-content button:hover {
  background-color: #09407a;
}
}
