/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   BODY
========================= */

body {
  font-family: Arial, sans-serif;

  background:
    linear-gradient(rgba(223, 223, 223, 0.88), rgba(223, 223, 223, 0.88)),
    url("imagenes/fondoBG.png");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  min-height: 100vh;

  padding-bottom: 40px;
}

/* =========================
   HEADER
========================= */

header {
  width: 100%;

  background: #074a7b;

  padding: 35px 20px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

  margin-bottom: 30px;
}

.logo {
  width: 160px;
  margin-bottom: 15px;
}

header h1 {
  color: white;
  font-size: 38px;
  font-weight: 700;
  text-align: center;
}

/* =========================
   NAV
========================= */

nav {
  width: 95%;
  max-width: 1200px;

  margin: auto auto 25px;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;

  flex-wrap: wrap;
}

nav button {
  border: none;

  background: white;

  color: #074a7b;

  padding: 14px 22px;

  border-radius: 50px;

  font-weight: 700;

  cursor: pointer;

  transition: 0.25s;

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

nav button:hover {
  background: #074a7b;
  color: white;

  transform: translateY(-2px);
}

/* =========================
   SECTIONS
========================= */

section {
  width: 95%;
  max-width: 1200px;

  margin: 25px auto;

  padding: 35px;

  border-radius: 28px;

  background: url("imagenes/fondosecction.webp"), rgba(255, 255, 255, 0.82);

  background-size: 300px, auto;
  background-repeat: repeat, no-repeat;

  backdrop-filter: blur(10px);

  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);

  border: 1px solid rgba(255, 255, 255, 0.4);

  display: none;
}

section.activa {
  display: block;
  animation: fadeUp 0.4s ease;
}

section h2 {
  color: #074a7b;

  font-size: 30px;

  margin-bottom: 30px;

  position: relative;

  padding-left: 18px;
}

section h2::before {
  content: "";

  position: absolute;

  left: 0;
  top: 50%;

  transform: translateY(-50%);

  width: 5px;
  height: 28px;

  background: #b82627;

  border-radius: 20px;
}

/* =========================
   INPUTS
========================= */

input,
select {
  width: 100%;
  

  padding: 15px;

  border: none;

  border-radius: 14px;

  background: #e2e8f0;

  margin: 8px;

  font-size: 14px;

  transition: 0.25s;
}

input:focus,
select:focus {
  outline: none;

  background: white;

  box-shadow: 0 0 0 4px rgba(46, 111, 242, 0.12);
}

/* =========================
   BOTONES
========================= */

button {
  border: none;

  background: #074a7b;

  color: white;

  padding: 14px 22px;

  border-radius: 50px;

  font-weight: 700;

  cursor: pointer;

  transition: 0.25s;

  margin: 8px;
}

button:hover {
  transform: translateY(-2px);

  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

button:disabled {
  background: #cbd5e1 !important;
  color: #64748b !important;

  cursor: not-allowed;

  opacity: 0.8;

  transform: none !important;

  box-shadow: none !important;
}

/* =========================
   TABLAS
========================= */

table {
  width: 100%;

  border-collapse: collapse;

  margin-top: 25px;

  overflow: hidden;

  border-radius: 20px;

  background: white;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

thead {
  background: #074a7b;
}

th {
  color: white;

  padding: 18px 14px;

  font-size: 14px;
}

td {
  padding: 15px;

  border-bottom: 1px solid #e5e7eb;

  text-align: center;
}

tr:hover td {
  background: #f8fafc;
}

/* =========================
   CARD CLIENTE
========================= */

.card {
  margin-top: 20px;

  padding: 22px 28px;

  border-radius: 20px;

  background: rgba(255, 255, 255, 0.82);

  backdrop-filter: blur(8px);

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);

  line-height: 1.4;

  max-width: 620px;
}

.card h3 {
  font-size: 22px;

  color: #074a7b;

  margin-bottom: 14px;

  font-weight: 700;
}

.card p {
  font-size: 16px;

  margin-bottom: 6px;

  color: #1f2937;
}

.card strong {
  color: #000;
}

/* =========================
   HELPERS
========================= */

.grupo-inputs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-start;
}

.campo{
  width:320px;
  display:flex;
  flex-direction:column;
}

.grupo-botones {
  margin-top: 10px;
}

.grupo-busqueda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.input-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.input-inline span {
  font-weight: bold;
  color: #074a7b;
}

/* =========================
   BOTONES CRÉDITO
========================= */

.grupo-botones-credito {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;

  margin-top: 10px;
  margin-bottom: 14px;
}

.grupo-botones-credito button {
  margin: 0;
}

/* =========================
   RESULTADO CRÉDITO
========================= */

#resultadoCredito {
  margin-top: 18px;

  padding: 20px 24px;

  border-radius: 22px;

  font-size: 16px;

  line-height: 1.8;

  font-weight: 600;

  max-width: 460px;

  width: 100%;
}

.aprobado {
  background: #dcfce7;

  color: #166534;

  border-left: 6px solid #16a34a;
}

.rechazado {
  background: #fee2e2;

  color: #991b1b;

  border-left: 6px solid #dc2626;
}

/* =========================
   FILAS RESULTADO
========================= */

.resultado-linea {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 20px;

  margin-bottom: 18px;
}

/* TEXTO IZQUIERDA */
.resultado-label {
  display: flex;
  align-items: center;

  gap: 12px;

  font-size: 18px;
}

/* VALORES */
.resultado-linea strong {
  font-size: 18px;
}
/* RESULTADO FINAL */
.resultado-total {
  margin-top: 22px;

  padding-top: 18px;

  border-top: 1px solid rgba(0, 0, 0, 0.12);

  font-size: 24px;

  font-weight: 800;
}
/* =========================
   ERRORES
========================= */

.mensaje-error {

  color: #dc2626;

  font-size: 13px;

  font-weight: 500;

  margin-top: 6px;

  margin-left: 12px;

  margin-bottom: 8px;

  width: 100%;
}

.input-error {
  border: 2px solid #dc2626 !important;
  animation: shake 0.25s;
}

/* =========================
   ANIMACIONES
========================= */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0);
  }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
  header h1 {
    font-size: 28px;
  }

  section {
    padding: 22px;
  }

  section h2 {
    font-size: 24px;
  }

  nav {
    flex-direction: column;
  }

  nav button {
    width: 100%;
  }

  input,
  select {
    max-width: 100%;
    margin: 8px 0;
  }

  button {
    width: 100%;
    margin: 8px 0;
  }

  .grupo-busqueda {
    flex-direction: column;
    align-items: stretch;
  }

  .grupo-botones-credito {
    flex-direction: column;
    align-items: stretch;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  th,
  td {
    min-width: 120px;
  }

  .card {
    max-width: 100%;
    padding: 20px;
  }

  .card h3 {
    font-size: 20px;
  }

  .card p {
    font-size: 15px;
  }

  #resultadoCredito {
    max-width: 100%;
    font-size: 15px;
  }
}
/* =========================
   ALERTA MODERNA
========================= */

.overlay-alerta{
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  background: rgba(0,0,0,.25);

  display: flex;

  justify-content: center;
  align-items: center;

  z-index: 9999;

  opacity: 0;

  transition: .3s;
}

.overlay-alerta.mostrar{
  opacity: 1;
}

.alerta-modal{
  width: 320px;

  background: white;

  border-radius: 28px;

  padding: 35px 25px;

  text-align: center;

  box-shadow: 0 25px 60px rgba(0,0,0,.25);

  transform: scale(.8);

  transition: .3s;
}

.overlay-alerta.mostrar .alerta-modal{
  transform: scale(1);
}

.alerta-check{
  width: 80px;
  height: 80px;

  margin: auto auto 18px;

  border-radius: 50%;

  background: #dcfce7;

  display: flex;

  align-items: center;
  justify-content: center;

  font-size: 42px;

  color: #16a34a;
}

.alerta-modal h2{
  color: #074a7b;

  font-size: 34px;

  margin-bottom: 10px;
}

.alerta-modal p{
  color: #475569;

  font-size: 17px;

  font-weight: 500;
}