/* SGTA Portal Moderno
   - Bootstrap 5 + Swiper
   - CSS variables set inline in portal.php (:root)
*/
:root{
  --bg:#f6f8ff;
  --text:#0b1220;
  --muted:#5b667a;
  --card: rgba(255,255,255,.86);
  --border:rgba(15, 23, 42, .12);
  --shadow:0 20px 50px rgba(2,6,23,.10);
  --radius:22px;
}

/* Theme variables (Light default). Dark applies via:
   - Auto: OS preference when no data-theme
   - Manual: html[data-theme="dark"|"light"] set by JS
*/
:root{
  --navbar-bg: rgba(255,255,255,.72);
  --navbar-border: rgba(15,23,42,.08);
  --nav-link: #334155;
  --dropdown-bg: rgba(255,255,255,.92);
  --dropdown-border: rgba(15,23,42,.10);
}

html[data-theme="dark"]{
  --bg:#050a17;
  --text:#e5e7eb;
  --muted:#a3adc2;
  --card: rgba(17,24,39,.72);
  --border: rgba(148,163,184,.18);
  --shadow:0 20px 50px rgba(0,0,0,.35);

  --navbar-bg: rgba(2,6,23,.62);
  --navbar-border: rgba(148,163,184,.14);
  --nav-link: rgba(226,232,240,.92);
  --dropdown-bg: rgba(2,6,23,.86);
  --dropdown-border: rgba(148,163,184,.18);
}

@media (prefers-color-scheme: dark){
  html:not([data-theme]){
    --bg:#050a17;
    --text:#e5e7eb;
    --muted:#a3adc2;
    --card: rgba(17,24,39,.72);
    --border: rgba(148,163,184,.18);
    --shadow:0 20px 50px rgba(0,0,0,.35);

    --navbar-bg: rgba(2,6,23,.62);
    --navbar-border: rgba(148,163,184,.14);
    --nav-link: rgba(226,232,240,.92);
    --dropdown-bg: rgba(2,6,23,.86);
    --dropdown-border: rgba(148,163,184,.18);
  }
}

/* Grid overlay tweaks for dark */
html[data-theme="dark"] body::before{
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  opacity: .18;
}
@media (prefers-color-scheme: dark){
  html:not([data-theme]) body::before{
    background-image:
      linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
    opacity: .18;
  }
}


html{ scroll-behavior:smooth; }
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(900px circle at 12% 10%, rgba(var(--c1-rgb, 13,110,253), .14), transparent 42%),
    radial-gradient(800px circle at 88% 18%, rgba(var(--c2-rgb, 11,94,215), .12), transparent 46%),
    radial-gradient(900px circle at 50% 100%, rgba(var(--c3-rgb, 25,135,84), .10), transparent 52%),
    var(--bg);
  min-height: 100vh;
}


body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(15,23,42,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,.06) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .35;
  mask-image: radial-gradient(900px circle at 50% 10%, rgba(0,0,0,1), rgba(0,0,0,.2) 45%, rgba(0,0,0,0) 72%);
}

.scroll-progress{
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 1100;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  box-shadow: 0 0 18px rgba(var(--c1-rgb, 13,110,253), .35);
}

@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; }
}



a{ color: var(--c1); text-decoration: none; }
a:hover{ color: var(--c2); }

.section{
  padding: clamp(48px, 6vw, 88px) 0;
}
.section-title{
  max-width: 860px;
  margin: 0 auto 28px;
  text-align: center;
}
.section-title h2{
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.section-title p{
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

/* Topbar */
.topbar{
  font-size: 14px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar a{ color: inherit; }
.topbar a:hover{ color: var(--c1); }
.topbar .social a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-left: 8px;
}
.topbar .social a:hover{
  border-color: rgba(13,110,253,.35);
}

/* Navbar */
.navbar{
  background: var(--navbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--navbar-border);
}
.navbar.scrolled{
  border-bottom-color: var(--border);
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
}
.brand-logo{
  max-height: 52px;
  width: auto;
}
@media (max-width: 576px){
  .brand-logo{ max-height: 44px; }
}
.nav-link{
  font-weight: 600;
  color: var(--nav-link) !important;
}
.nav-link:hover{ color: var(--c1) !important; }
.navbar .btn-cta{
  border: 0;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .01em;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 14px 34px rgba(var(--c1-rgb, 13,110,253), .18);
}

/* Hero slider */
.hero{
  padding-top: 88px; /* navbar spacing */
}
@media (max-width: 991.98px){
  .hero{ padding-top: 76px; }
}
.hero .hero-swiper{
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.55);
}
.hero .swiper-slide{
  /*
    IMPORTANTE:
    En escritorio antes usábamos `object-fit: cover` + una altura fija (vh),
    lo que recortaba ("cortaba") imágenes panorámicas como 2048×600.
    Con `aspect-ratio` + `object-fit: contain` se ve SIEMPRE la imagen completa.
  */
  aspect-ratio: 2048 / 600;
  height: auto;
  background: #050a17;
}
.hero .swiper-slide img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050a17;
  display:block;
}

@media (max-width: 767.98px){
  .hero .hero-swiper{
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.55);
}
  /* En móvil forzamos una altura agradable y seguimos mostrando la imagen completa */
  .hero .swiper-slide{ height: 260px; aspect-ratio: auto; }
  .hero .swiper-button-next,
  .hero .swiper-button-prev{ display:none; }
  .hero .swiper-pagination{ bottom: 10px !important; }
}
.hero .swiper-button-next,
.hero .swiper-button-prev{
  color: rgba(255,255,255,.85);
  text-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.hero .swiper-button-next:after,
.hero .swiper-button-prev:after{
  font-size: 26px;
  font-weight: 900;
}
@media (max-width: 768px){
  .hero .swiper-button-next,
  .hero .swiper-button-prev{ display:none; }
}

/* "Guiones" indicators */
.hero .swiper-pagination{
  bottom: 14px !important;
}
.hero .swiper-pagination-bullet{
  width: 22px;
  height: 6px;
  border-radius: 999px;
  background: rgba(15,23,42,.18);
  opacity: 1;
  transition: width .18s ease, background .18s ease, transform .18s ease;
}
.hero .swiper-pagination-bullet-active{
  width: 38px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  transform: translateY(-1px);
}

/* Feature cards */
.feature-card{
  position: relative;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
  border: 1px solid rgba(255,255,255,.60);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(2,6,23,.06);
  padding: 22px 22px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature-icon{
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(13,110,253,.10);
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--c1);
  margin-bottom: 14px;
  font-size: 20px;
}
.feature-card h3{
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 8px;
}
.feature-card p{
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* Info section */
.info-wrap{
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.74));
  border: 1px solid rgba(255,255,255,.60);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 42px);
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.info-wrap h2{
  font-weight: 850;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.info-wrap p{
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}
.info-wrap .btn{
  border-radius: 999px;
  font-weight: 800;
  padding: .6rem 1.05rem;
}

/* Contact */
.contact-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  padding: 18px;
  height: 100%;
  box-shadow: 0 10px 24px rgba(2,6,23,.04);
}
.contact-card .ic{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(25,135,84,.10);
  color: var(--c3);
  font-size: 18px;
  margin-bottom: 12px;
}
.contact-card h4{
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 6px;
}
.contact-card p{
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-word;
}

.form-card{
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(2,6,23,.06);
  padding: 22px;
}
.form-card .form-control{
  border-radius: 14px;
  padding: 12px 14px;
  border-color: rgba(15, 23, 42, .12);
}
.form-card .btn{
  border-radius: 999px;
  font-weight: 800;
  padding: .65rem 1.1rem;
}

/* Footer */
.footer{
  background: #050a17;
  color: rgba(255,255,255,.82);
  padding: 42px 0;
  margin-top: 20px;
}
.footer a{ color: rgba(255,255,255,.82); }
.footer a:hover{ color: #fff; }
.footer .small{ color: rgba(255,255,255,.62) }
.footer .social a{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-right: 8px;
}
.footer .social a:hover{
  border-color: rgba(255,255,255,.25);
}

/* Back-to-top */
.back-to-top{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(11,18,32,.88);
  color: #fff;
  display: none;
  align-items:center;
  justify-content:center;
  z-index: 1040;
  box-shadow: 0 14px 30px rgba(0,0,0,.25);
}
.back-to-top:hover{ background: rgba(11,18,32,.98); }

/* WhatsApp floating button */
.whatsapp-fab{
  position: fixed;
  right: 18px;
  bottom: 76px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #25D366;
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 1040;
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
}
.whatsapp-fab:hover{ filter: brightness(.96); }

/* Snackbar (compat con Mapos flashdata) */
#snackbar{
  visibility: hidden;
  min-width: 280px;
  max-width: min(560px, calc(100vw - 32px));
  background-color: #111827;
  color: #fff;
  text-align: left;
  border-radius: 16px;
  padding: 14px 16px;
  position: fixed;
  z-index: 2000;
  left: 16px;
  bottom: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  font-weight: 650;
}
#snackbar.show{
  visibility: visible;
  animation: fadein .25s, fadeout .25s 2.75s;
}
#snackbar.bg-success{ background-color: #0f5132; }
#snackbar.bg-danger{ background-color: #842029; }
#snackbar.bg-warning{ background-color: #664d03; }
#snackbar.bg-info{ background-color: #055160; }

@keyframes fadein{ from{ transform: translateY(10px); opacity: 0;} to{ transform: translateY(0); opacity: 1;} }
@keyframes fadeout{ from{ transform: translateY(0); opacity: 1;} to{ transform: translateY(10px); opacity: 0;} }

/* Section anchors with fixed navbar */
[id]{ scroll-margin-top: 92px; }


.btn-cta:hover{ filter: brightness(1.02); transform: translateY(-1px); box-shadow: 0 18px 44px rgba(var(--c1-rgb, 13,110,253), .26); }

.feature-card::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(var(--c1-rgb, 13,110,253), .35), rgba(var(--c2-rgb, 11,94,215), .18), rgba(var(--c3-rgb, 25,135,84), .12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events:none;
}

.feature-card:hover{ transform: translateY(-4px); box-shadow: 0 18px 46px rgba(2,6,23,.12); }

/* Reveal animations */
.reveal{
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .55s ease, transform .55s ease;
  will-change: opacity, transform;
}
.reveal.reveal-in{
  opacity: 1;
  transform: none;
}


/* Theme dropdown */
.dropdown-menu{
  background: var(--dropdown-bg);
  border: 1px solid var(--dropdown-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.dropdown-item{
  color: var(--text);
}
.dropdown-item:hover{
  background: rgba(var(--c1-rgb, 13,110,253), .12);
  color: var(--text);
}
.dropdown-item.active,
.dropdown-item:active{
  background: rgba(var(--c1-rgb, 13,110,253), .16);
  color: var(--text);
}

/* ==================================================
   Fix: Dark theme must NOT use light card gradients
   (Feature cards + Info block + Contact texts)
   ================================================== */

/* Manual dark (html[data-theme="dark"]) */
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .info-wrap{
  background: linear-gradient(180deg, rgba(17,24,39,.82), rgba(2,6,23,.62)) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
}

html[data-theme="dark"] .feature-card h3,
html[data-theme="dark"] .info-wrap h2,
html[data-theme="dark"] .contact-card h4,
html[data-theme="dark"] .form-card h3{
  color: rgba(255,255,255,.96) !important;
}

html[data-theme="dark"] .feature-card p,
html[data-theme="dark"] .info-wrap p,
html[data-theme="dark"] .contact-card p,
html[data-theme="dark"] .contact-card a,
html[data-theme="dark"] .section-title p,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .small.text-muted{
  color: rgba(255,255,255,.86) !important;
}

/* Auto dark (SO en oscuro + sin selección manual) */
@media (prefers-color-scheme: dark){
  html:not([data-theme]) .feature-card,
  html:not([data-theme]) .info-wrap{
    background: linear-gradient(180deg, rgba(17,24,39,.82), rgba(2,6,23,.62)) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
  }

  html:not([data-theme]) .feature-card h3,
  html:not([data-theme]) .info-wrap h2,
  html:not([data-theme]) .contact-card h4,
  html:not([data-theme]) .form-card h3{
    color: rgba(255,255,255,.96) !important;
  }

  html:not([data-theme]) .feature-card p,
  html:not([data-theme]) .info-wrap p,
  html:not([data-theme]) .contact-card p,
  html:not([data-theme]) .contact-card a,
  html:not([data-theme]) .section-title p,
  html:not([data-theme]) .text-muted,
  html:not([data-theme]) .small.text-muted{
    color: rgba(255,255,255,.86) !important;
  }
}

/* ===============================
   MODALES en modo oscuro
   (Términos / Políticas / Reparación)
   =============================== */

html[data-theme="dark"] .modal-content{
  background: #0b1220 !important;
  color: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer{
  border-color: rgba(255,255,255,.12) !important;
}

html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .modal-body *{
  color: rgba(255,255,255,.92) !important;
}

html[data-theme="dark"] .btn-close{
  filter: invert(1) grayscale(100%) brightness(1.2);
}

/* Links dentro del modal */
html[data-theme="dark"] .modal-body a{
  color: rgba(255,255,255,.92) !important;
  text-decoration: underline;
}


.richtext h1{ font-size: 2rem; margin: 0 0 .75rem; }
.richtext h2{ font-size: 1.6rem; margin: 0 0 .6rem; }
.richtext h3{ font-size: 1.25rem; margin: 0 0 .5rem; }

.richtext p{ margin: 0 0 .75rem; }
.richtext ul, .richtext ol{ margin: .25rem 0 .75rem 1.1rem; }
.richtext li{ margin: .25rem 0; }

/* Que herede el color según tema (claro/oscuro) */
.richtext, .richtext *{ color: inherit; }

