/* ================================================
   Firma Crédito Automotriz - Banco de Chile
   Custom styles (Bootstrap 5 base)
   ================================================ */

/* ---- Row 1: Contenido + fondo back.jpg ---- */
.row-content {
  background: url("../img/back.jpg") no-repeat center center;
  background-size: cover;
  padding: 0;
  overflow: visible;
  position: relative;
  z-index: 2;
}

/* ---- Row 2: Seguridad + fondo footer.jpg ---- */
.row-security {
  background: url("../img/footer.jpg") no-repeat center center;
  background-size: cover;
  height: 300px;
  padding: 0 0 20px 0;
  position: relative;
  z-index: 1;
}

/* ---- Wrapper para posicionar el card flotante ---- */
.form-wrapper {
  position: relative;
  min-height: 500px;
}

/* ---- Contenedor del formulario ---- */
.row.align-items-start {
  z-index: 600;
  position: relative;
  top: 0px;
}

@media (max-width: 768px) {
  .row.align-items-start {
    top: 50px;
  }
}

/* ---- Centrar título verticalmente ---- */
.row.align-items-start > .col-lg-6 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 500px;
}

/* ---- Card formulario flotante ---- */
.card-form {
  width: 100%;
  max-width: 487px;
  min-height: 630px;
  position: absolute;
  top: 64px;
  right: 0;
  z-index: 10;
  border-radius: 0 !important;
}
 

.title-form {
  color: #022464 !important;
  font-size: clamp(18px, 3vw, 24px);
}

.text-footer-form {
  color: #022464 !important;
  font-size: clamp(14px, 2.5vw, 16px);
}


.text-security {
  color: #022464;
  font-size: 17px;
  font-weight: 600;
}

.security-shield {
  height: 40px;
  width: auto;
}

/* ---- Row 3: Footer ---- */
.row-footer {
  background: #011a3a;
  padding: 16px 0;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.footer-link {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-link:hover {
  color: #ffffff;
}

/* ---- Acento azul ---- */
.line-accent {
  width: 60px;
  height: 4px;
  background: #75A6FF;
  margin-bottom: 20px;
  border-radius: 2px;
}

/* ---- Texto blanco con opacidad ---- */
.text-white-75 {
  color: rgba(255, 255, 255, 0.85);
}

/* ---- Textos index (welcome page) ---- */
.welcome-text {
  font-family: 'Nunito Sans', sans-serif;
  font-size: clamp(18px, 3vw, 25px);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.6;
}

.welcome-text-conditions {
  font-family: 'Nunito Sans', sans-serif;
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.6;
}

.welcome-question {
  font-family: 'Nunito Sans', sans-serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  color: #ffffff;
}

/* ---- Centrado perfecto para welcome page ---- */
.welcome-container {
  display: flex;
  align-items: center;
  justify-content: center;
  /*min-height: 70vh;*/
  text-align: left;
}

.welcome-container h1 {
  font-size: clamp(24px, 5vw, 48px) !important;
}

/* ---- Botones pill ---- */
.btn-pill-primary {
  background: #3769ff;
  color: #ffffff;
  border: 2px solid #3769ff;
  border-radius: 30px;
  padding: 10px 40px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-pill-primary:hover {
  background: #2a54d4;
  border-color: #2a54d4;
  color: #ffffff;
}

.btn-pill-primary:active {
  background: #1e3d99;
  border-color: #1e3d99;
}

.btn-pill-primary:disabled {
  background: #b0b0b0;
  border-color: #b0b0b0;
  color: #ffffff;
  cursor: not-allowed;
}

.btn-pill-error {
  background: transparent;
  color: #c93232;
  border: 2px solid #c93232;
  border-radius: 30px;
  padding: 10px 40px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-pill-error:hover {
  background: #c93232;
  color: #ffffff;
}

.btn-pill-error-outline {
  background: #ffffff;
  color: #c93232;
  border: 2px solid #c93232;
  border-radius: 30px;
  padding: 10px 40px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-pill-error-outline:hover {
  background: #f8e8e8;
  color: #c93232;
}

/* ---- Error page ---- */
.card-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-title {
  font-size: 26px;
  font-weight: 400;
  color: #c93232;
}

.error-message {
  font-size: 20px;
  color: #5C5D60;
  line-height: 1.4;
}

/* ---- Inputs custom ---- */
.form-control-lg {
  border-radius: 8px;
  background: #f9f9f9;
}

.form-control-lg:focus {
  border-color: #3769ff;
  box-shadow: 0 0 0 0.2rem rgba(55, 105, 255, 0.15);
}

/* ---- Input con error ---- */
.form-control.is-invalid {
  border-color: #c93232;
  background-color: #fff0f0;
  box-shadow: none;
}

.form-control.is-invalid:focus {
  border-color: #c93232;
  box-shadow: 0 0 0 0.2rem rgba(201, 50, 50, 0.15);
}

.field-error {
  color: #c93232;
  font-size: 0.8rem;
  margin-top: 5px;
  display: block;
}

/* ---- Loading overlay ---- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 26, 58, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Responsive ---- */

/* Tablets landscape y pantallas medianas (769px - 1024px) */
@media (max-width: 1024px) {
  .card-form {
    max-width: 90%;
    width: 100%;
    top: 60px;
  }

  .form-wrapper {
    min-height: 400px;
  }

  .row-content {
    padding: 40px 0;
  }
}

/* Tablets portrait (769px - 992px) */
@media (max-width: 992px) {
  .card-form {
    max-width: 95%;
    top: 60px;
  }

  .form-wrapper {
    min-height: 300px;
  }
}

/* Tamaños fijos hasta 1200px */
@media (max-width: 1200px) {
  .title-form {
    font-size: 20px !important;
  }

  .text-footer-form {
    font-size: 14px !important;
  }
}

/* Móviles (hasta 768px) */
@media (max-width: 768px) {
  .row-content {
    padding: 20px 15px;
  }

  .card-form {
    position: static;
    width: 100%;
    max-width: 100%;
    min-height: auto;
    margin-top: 0;
    margin-bottom: 0;
    top: 0;
  }

   .form-wrapper {
    position: static;
    min-height: auto;
    padding: 0 10px;
    max-width: 458px;
    position: relative;
  }

  .row-security {
    background: url("../img/footer.jpg") no-repeat center center;
    background-size: cover;
    height: 145px;
    padding: 0 0 20px 0;
    position: relative;
    z-index: 1;
    padding-bottom: 20px !important;
    display: flex !important;
    align-items: flex-end !important;
  }

  .row-security .container {
    width: 100%;
  }

  /* Título sin min-height en móvil */
  .row.align-items-start > .col-lg-6 {
    min-height: auto;
    padding: 0 15px;
    margin-bottom: 0;
  }

  /* Título en una línea con separación de 20px */
  .row.align-items-start > .col-lg-6 h1 {
    font-size: clamp(24px, 5.5vw, 32px) !important;
    margin-bottom: 20px;
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Acento más pequeño en móvil */
  .line-accent {
    margin-bottom: 10px;
  }

  .text-security {
    font-size: 14px;
    text-align: center;
  }

  /* Centrar pregunta solo en móvil */
  .welcome-question {
    text-align: center;
  }

  /* Botones en columna (100% ancho) */
  .welcome-container .d-flex {
    flex-direction: column;
    width: 100%;
  }

  .welcome-container .btn-pill-primary {
    width: 100%;
  }

  /* Sección seguridad con padding 60px */
  .row-security {
    padding: 0 0 20px 0  !important;
  }

  .error-title {
    font-size: 20px;
  }

  .error-message {
    font-size: 16px;
  }

  .row-footer .container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  /* Card más compacto en móvil */
  .card-form.card {
    padding: 20px 15px !important;
  }

  /* Inputs más pequeños en móvil */
  .form-control-lg {
    padding: 10px 12px;
    font-size: 1rem;
  }

  /* Botón más compacto */
  .btn-pill-primary {
    padding: 10px 30px;
    font-size: 0.95rem;
  }
}

/* ================================================
   Utility Classes (CSP-safe)
   ================================================ */

/* Hidden by default (instead of style="display:none;") */
.d-none {
  display: none;
}

/* Welcome page col padding */
.welcome-col-padding {
  padding: 60px 10px;
}

/* Error page large icon */
.error-icon-large {
  font-size: 4rem;
}
