/* public/css/main.css */
@import url("https://fonts.googleapis.com/css2?family=Lora:wght@400;500&family=Poppins:wght@400;500;600;700&display=swap");

/* =============== VARIABLES CSS ============== =*/
:root {
  --header-height: 4rem;
  --first-color: #35bb14;
  --second-color: #00e6c7;
  --gradient-color: linear-gradient(75deg, var(--second-color) 20%, var(--first-color) 66%);
  
  --title-color: hsl(260, 80%, 18%);
  --text-color: hsl(260, 24%, 32%);
  --text-color-light: hsl(260, 16%, 65%);
  --body-color: hsl(215, 55%, 96%);
  --container-color: #ffffff;
  
  --body-font: "Poppins", sans-serif;
  --second-font: "Lora", serif;
}

/* ========== MODO OSCURO ========== */
body.dark {
  --title-color: hsl(260, 64%, 85%);
  --text-color: hsl(260, 20%, 65%);
  --body-color: hsl(0, 0%, 8%);
  --container-color: hsl(262, 34%, 19%);
}

.dark .blur-header {
  background-color: hsla(0, 0%, 0%, 0.3);
}

.dark .NavMenu {
  background-color: hsla(0, 0%, 0%, 0.9);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  background-color: var(--body-color);
  color: var(--text-color);
  line-height: 1.6;
  padding-top: var(--header-height);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =============== SCROLL BAR =============== */
::-webkit-scrollbar {
  width: 0.6rem;
  background-color: hsl(260, 16%, 85%);
  border-radius: 0.5rem;
}

::-webkit-scrollbar-thumb {
  border-radius: 0.6rem;
  background-color: hsl(260, 16%, 65%);
}

::-webkit-scrollbar-thumb:hover {
  background-color: hsl(260, 16%, 55%);
}

.Main {
  flex: 1; /* Hace que el footer baje al fondo si hay poco contenido */
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }

/* Layout & Containers */
.Container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.Grid {
  display: grid;
  gap: 1.5rem;
}

/* ==================== HEADER & NAVBAR ==================== */
.Header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--body-color);
  z-index: 100;
  transition: background-color 0.4s;
}

.blur-header {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.Nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.LinkNavBar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--second-font);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-color);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.LinkNavBar img {
  height: 32px;
}

.NavMenu {
  display: flex;
}

.NavList {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.NavLink {
  font-weight: 500;
  color: var(--title-color);
  transition: color 0.3s;
}

.NavLink:hover, .ActiveLink {
  background: var(--gradient-color);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.NavLink.Credito {
  background-color: var(--first-color);
  color: #fff;
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  -webkit-background-clip: initial;
  background-clip: initial;
  transition: background-color 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
  box-shadow: 0 4px 10px rgba(53, 187, 20, 0.3);
}

.NavLink.Credito:hover {
  background-color: #2da111;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(53, 187, 20, 0.4);
}

.NavButtons {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.ChangeTheme, .NavToggle, .NavClose {
  font-size: 1.5rem;
  color: var(--title-color);
  cursor: pointer;
}

.NavClose, .NavToggle {
  display: none;
}

/* ==================== HERO SECTION ==================== */
.Home {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: url('../img/fondo.jpg') center/cover no-repeat;
}

.HomeOverlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.HomeContent {
  position: relative;
  z-index: 10;
  color: #fff;
}

.TitleHome img {
  max-width: 380px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
  animation: pulseAndRotate 3s ease-in-out infinite;
}

@keyframes pulseAndRotate {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(2deg); }
  50% { transform: scale(1.08); }
  75% { transform: scale(1.05) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.DescripcionH {
  font-size: 2.2rem;
  color: var(--second-color);
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
  margin-top: 1rem;
}

/* ==================== INFO SECTIONS ==================== */
.Creditos, .Portafolio {
  padding: 5rem 0;
}

.CreditosContent, .PortafolioContent {
  display: flex;
  align-items: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.CreditosImg {
  display: flex;
  justify-content: center;
  align-items: center;
}

.CreditosImg img {
  width: 400px;
  max-width: 100%;
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.CreditosImg img:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.PortafolioImg img {
  max-width: 100%;
  border-radius: 1rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.InfoCredito, .PortafolioInfo {
  flex: 1;
  min-width: 300px;
}

.TitleCreditoss, .TitlePortafolio {
  font-size: 2.5rem;
  color: var(--first-color);
  margin-bottom: 1rem;
}

.DescripcionC, .DescripcionP {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 2rem;
}

.ButtonCredito, .ButtonPortafolio {
  background-color: var(--first-color);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 2rem;
  font-weight: 600;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 4px 10px rgba(53, 187, 20, 0.3);
}

.ButtonCredito:hover, .ButtonPortafolio:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 15px rgba(53, 187, 20, 0.4);
  background-color: #2da111;
}

/* ==================== BENEFICIOS & REQUISITOS (Créditos) ==================== */
.Beneficios, .Requisitos {
  padding: 5rem 0;
}

.BeneficiosContent, .RequisitosContent {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .BeneficiosContent, .RequisitosContent {
    flex-direction: row;
  }
}

.BeneficiosImg {
  order: 1;
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
}

.PortafolioImg {
  order: 0;
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .BeneficiosImg {
    order: 0;
    margin: 0;
  }
  .PortafolioImg {
    order: 1;
    margin: 0;
  }
}

.BeneficiosImg img, .PortafolioImg img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transition: transform 0.4s ease;
}

.BeneficiosImg img:hover, .PortafolioImg img:hover {
  transform: scale(1.03);
}

.InfoBeneficios, .RequisitosInfo {
  text-align: left;
  flex: 1;
}

@media (min-width: 768px) {
  .RequisitosInfo {
    order: 1;
  }
}

.TitleBeneficios, .TitleRequisitos {
  font-size: 2.25rem;
  color: var(--title-color);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.InfoBeneficios ul, .RequisitosInfo ul {
  padding-left: 20px;
  margin-bottom: 2rem;
}

.InfoBeneficios li, .RequisitosInfo li {
  font-size: 1.1rem;
  color: var(--text-color);
  line-height: 1.6;
  margin-bottom: 1rem;
  position: relative;
}

.InfoBeneficios li::before, .RequisitosInfo li::before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: var(--first-color);
  border-radius: 50%;
  position: absolute;
  left: -20px;
  top: 8px;
}

.InfoBeneficios span, .RequisitosInfo span {
  background: var(--gradient-color);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* ==================== BUTTON HERO SOLICITAR ==================== */
.ButtonSolicitar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  background: linear-gradient(75deg, var(--first-color) 20%, var(--second-color) 66%);
  color: #fff;
  border: none;
  border-radius: 2rem;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  animation: doublePulse 3s infinite;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s;
  box-shadow: 0 4px 15px rgba(53, 187, 20, 0.3);
}

.ButtonSolicitar:hover {
  background: linear-gradient(75deg, var(--second-color) 20%, var(--first-color) 66%);
  box-shadow: 0 6px 20px rgba(53, 187, 20, 0.5);
}

.ButtonSolicitar i {
  transition: transform 0.3s ease;
  font-size: 1.3rem;
}

.ButtonSolicitar:hover i {
  transform: translateX(6px);
}

@keyframes doublePulse {
  0%, 100% { transform: scale(1); }
  10%, 20% { transform: scale(1.08); }
  30% { transform: scale(1); }
  40%, 50% { transform: scale(1.08); }
  60% { transform: scale(1); }
}

.ButtonBeneficios, .ButtonRequisitos {
  background-color: var(--first-color);
  color: white;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 4px 10px rgba(53, 187, 20, 0.3);
}

.ButtonBeneficios:hover, .ButtonRequisitos:hover {
  background-color: var(--second-color);
  color: #000;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 15px rgba(53, 187, 20, 0.4);
}

/* ==================== LINEAS DE ATENCION ==================== */
.LineasDeAtencion {
  padding: 5rem 0;
  background-color: var(--body-color);
}

.TitleSection {
  text-align: center;
  font-size: 2rem;
  color: var(--title-color);
  margin-bottom: 0.5rem;
}

.LineasDeAtencionSubtitle {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-color-light);
}

.ContactosGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.ContactoCard {
  background-color: var(--container-color);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  border: 1px solid rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.ContactoCard::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: var(--gradient-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.ContactoCard:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.ContactoCard:hover::before {
  transform: scaleX(1);
}

.CardArea {
  color: var(--first-color);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--body-color);
}

.CardResponsable {
  margin-bottom: 1rem;
}

.CardLink {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  transition: color 0.3s;
  word-break: break-all;
  line-height: 1.4;
}

.CardLink i {
  color: var(--first-color);
  font-size: 1.25rem;
  margin-top: 0.1rem;
}

.CardLink:hover {
  color: var(--first-color);
}

/* ==================== MODALS ==================== */
.ModalOverlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.ModalOverlay.active {
  opacity: 1;
  visibility: visible;
}

.ModalContent {
  background: var(--container-color);
  padding: 2.5rem;
  border-radius: 1.5rem;
  max-width: 550px;
  width: 90%;
  position: relative;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.ModalBodyAviso, .ModalBodyInfo {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 0.5rem; /* Espacio para que el scroll no toque el texto */
}

/* Scrollbar interno para los cuerpos del modal */
.ModalBodyAviso::-webkit-scrollbar,
.ModalBodyInfo::-webkit-scrollbar {
  width: 0.4rem;
}

.ModalBodyAviso::-webkit-scrollbar-track,
.ModalBodyInfo::-webkit-scrollbar-track {
  background: transparent;
}

.ModalBodyAviso::-webkit-scrollbar-thumb,
.ModalBodyInfo::-webkit-scrollbar-thumb {
  background-color: var(--first-color);
  border-radius: 1rem;
}

.ModalContent h2 {
  color: var(--title-color);
  font-family: var(--second-font);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.ModalClose {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--title-color);
  transition: color 0.3s, transform 0.3s;
}

.ModalClose:hover {
  color: var(--first-color);
  transform: rotate(90deg);
}

.ModalContact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.ModalButton, .ModalLink {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background-color: var(--first-color);
  color: #fff;
  font-weight: 600;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s, background-color 0.3s;
  border: 2px solid transparent;
}

.ModalButton:hover, .ModalLink:hover {
  background-color: #2da111;
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(53, 187, 20, 0.3);
}

.ModalLink {
  background-color: transparent;
  color: var(--first-color);
  border-color: var(--first-color);
}
.ModalLink:hover {
  background-color: var(--first-color);
  color: #fff;
}

.ModalBodyAviso {
  text-align: justify;
  margin-top: 1rem;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-color);
}

.ModalBodyAviso ul {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background-color: hsla(108, 80%, 40%, 0.05);
  border-left: 4px solid var(--first-color);
  border-radius: 0.5rem;
  list-style: none;
}

.ModalBodyAviso ul li {
  font-size: 1.15rem;
  color: var(--title-color);
  font-weight: 500;
}

/* Formularios en Modales */
.FormInput {
  width: 100%;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  border: 2px solid rgba(0,0,0,0.1);
  background: var(--body-color);
  color: var(--text-color);
  font-family: var(--body-font);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  text-align: center;
  font-weight: 600;
  letter-spacing: 2px;
}

.FormInput:focus {
  outline: none;
  border-color: var(--first-color);
  box-shadow: 0 0 0 4px rgba(53, 187, 20, 0.1);
}

.Loader {
  color: var(--first-color);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* ==================== FORMULARIO DE CRÉDITO ==================== */
.GlassCard {
  background: var(--container-color);
  padding: 3rem 2rem;
  border-radius: 2rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  margin-top: 5rem;
  margin-bottom: 3rem;
}

.PasoTitle {
  font-size: 1.5rem;
  color: var(--title-color);
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--first-color-light);
  padding-bottom: 0.5rem;
}

.GridForm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.InputField {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.FormuLabel {
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 600;
  margin-left: 0.5rem;
}

.FormuInput {
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(0,0,0,0.1);
  background: var(--body-color);
  color: var(--text-color);
  font-family: var(--body-font);
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.FormuInput:focus {
  outline: none;
  border-color: var(--first-color);
  box-shadow: 0 0 0 4px rgba(53, 187, 20, 0.1);
}

.FormuInput[readonly] {
  background: rgba(0,0,0,0.03);
  cursor: not-allowed;
  opacity: 0.8;
}
.dark .FormuInput[readonly] {
  background: rgba(255,255,255,0.05);
}

.FileUploadBox {
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(53, 187, 20, 0.5);
  padding: 1.5rem;
  border-radius: 1rem;
  background: rgba(53, 187, 20, 0.05);
}

.HiddenFile {
  display: none;
}

.ButtonFile {
  background: var(--first-color);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 2rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.3s, background 0.3s;
}

.ButtonFile:hover {
  background: var(--second-color);
  transform: translateY(-2px);
  color: #000;
}

.FilePreview {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--first-color);
  font-weight: 600;
  text-align: center;
  word-break: break-all;
}

.PasosStepper {
  text-align: center;
  margin-top: 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--title-color);
}

.ProgressBar {
  width: 100%;
  height: 8px;
  background: var(--body-color);
  border-radius: 10px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.ProgressFill {
  height: 100%;
  background: linear-gradient(75deg, var(--first-color) 20%, var(--second-color) 66%);
  width: 33.33%;
  transition: width 0.4s ease;
}

/* ==================== FOOTER ==================== */
.Footer {
  background-color: hsl(0, 0%, 8%); /* Negro del dark mode */
  color: hsl(260, 16%, 65%);
  padding: 4rem 0 2rem;
}

.FooterContainer {
  display: grid;
  gap: 3rem;
}

.FooterContent {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 3rem;
}

.FooterLogo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--first-color);
  font-family: var(--second-font);
  font-size: 1.5rem;
  font-weight: 500;
}

.FooterLogo img {
  height: 36px;
}

.FooterTitle {
  color: hsl(260, 64%, 85%);
  margin-bottom: 1.25rem;
  font-family: var(--second-font);
  font-size: 1.25rem;
}

.whatsapp-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.3s ease, color 0.3s ease;
  margin-bottom: 1rem;
}

.whatsapp-link i {
  color: var(--first-color);
  font-size: 1.25rem;
}

.whatsapp-link:hover {
  color: var(--second-color);
  transform: scale(1.05);
}

.FooterGroup {
  text-align: center;
  font-size: 0.813rem;
  margin-top: 1rem;
}

.FooterDescription {
  margin-top: 1rem;
  color: var(--text-color-light);
  font-size: 0.95rem;
  max-width: 320px;
  line-height: 1.5;
}

/* ==================== SCROLL UP ==================== */
.scrollup {
  position: fixed;
  right: 1.5rem;
  bottom: -50%;
  background: var(--gradient-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  color: #fff;
  border-radius: 50%;
  z-index: 100;
  transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.4s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.scrollup:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.show-scroll {
  bottom: 3rem;
}

/* ==================== RESPONSIVE ==================== */
@media screen and (max-width: 768px) {
  .NavMenu {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    background-color: var(--body-color);
    padding: 3rem 0;
    transition: top 0.4s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }
  
  .NavList {
    flex-direction: column;
  }
  
  .NavMenu.show-menu {
    top: 0;
  }
  
  .NavToggle, .NavClose {
    display: block;
  }
  
  .NavClose {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
  }
}
