/* =========================================================================
   CAP Consultores Asociados SAS — Hoja de estilos principal
   Autor: Jose Guillermo Ortiz Hernandez
   -------------------------------------------------------------------------
   Sistema de diseño:
   - Color:  Azul marino institucional + azul CAP + acento dorado "sello"
   - Tipografía: Fraunces (display), Public Sans (texto), IBM Plex Mono (datos)
   - Firma visual: "línea de balance" (regla con marcas tipo libro contable)
     usada como separador de secciones, y "sello" circular de confianza.
   ========================================================================= */

:root {
  /* --- Paleta --- */
  --navy: #0B2545;
  --blue: #1B4B8A;
  --blue-light: #2E7DD1;
  --royal: #0046FE;
  --blue-pale: #EAF1FB;
  --surface-alt: #F5F8FC;
  --gold: #B8973F;
  --ink: #14213D;
  --ink-soft: #48546B;
  --line: #D8E2F0;
  --white: #FFFFFF;

  /* --- Tipografía --- */
  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* --- Espaciado / radios --- */
  --radius: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 10px rgba(11, 37, 69, 0.06);
  --shadow-md: 0 12px 32px rgba(11, 37, 69, 0.12);
  --header-h: 84px;
}

/* =========================================================================
   Base
   ========================================================================= */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.35rem; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--royal); }

.text-mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
}

.lead-soft { color: var(--ink-soft); font-size: 1.08rem; }

.section { padding: 5.5rem 0; }
.section-alt { background: var(--surface-alt); }

/* Focus visibility (accesibilidad) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* =========================================================================
   Font Awesome en toda la iconografía: reemplaza los iconos nativos de
   Bootstrap (hamburguesa, chevron de acordeón, botón cerrar) por glifos
   de Font Awesome en lugar de los SVG por defecto de Bootstrap.
   ========================================================================= */
.navbar-toggler { border: none; box-shadow: none !important; padding: 0.35rem 0.5rem; }
.navbar-toggler-icon {
  background-image: none !important;
  width: auto; height: auto;
  display: inline-block;
}
.navbar-toggler-icon::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f0c9"; /* fa-bars */
  font-size: 1.4rem;
  color: var(--navy);
  line-height: 1;
}

.accordion-button::after {
  background-image: none !important;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f078"; /* fa-chevron-down */
  font-size: 0.85rem;
  transition: transform 0.2s ease;
  color: var(--blue);
}
.accordion-button:not(.collapsed)::after { transform: rotate(-180deg); }

.btn-close {
  background-image: none !important;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  opacity: 0.7;
}
.btn-close::before { content: "\f00d"; /* fa-xmark */ color: var(--ink); font-size: 1rem; }
.btn-close:hover { opacity: 1; }

/* =========================================================================
   Firma visual: línea de balance (ledger rule)
   Separador de secciones que evoca una regla de estado financiero.
   ========================================================================= */
.ledger-rule {
  position: relative;
  height: 24px;
  margin: 0 auto;
  max-width: 1140px;
  padding: 0 1rem;
}
.ledger-rule::before {
  content: "";
  position: absolute;
  left: 1rem; right: 1rem; top: 50%;
  height: 1px;
  background: var(--line);
}
.ledger-rule::after {
  content: "";
  position: absolute;
  left: 1rem; right: 1rem; top: calc(50% - 6px);
  height: 6px;
  background-image: repeating-linear-gradient(
    90deg, var(--line) 0, var(--line) 1px, transparent 1px, transparent 48px
  );
}

/* =========================================================================
   Botones
   ========================================================================= */
.btn-cap-primary {
  background: var(--navy);
  border: 1px solid var(--navy);
  color: var(--white);
  font-weight: 600;
  padding: 0.72rem 1.5rem;
  border-radius: var(--radius);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn-cap-primary:hover, .btn-cap-primary:focus-visible {
  background: var(--royal);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-cap-outline {
  background: transparent;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  font-weight: 600;
  padding: 0.68rem 1.5rem;
  border-radius: var(--radius);
  transition: all .18s ease;
}
.btn-cap-outline:hover, .btn-cap-outline:focus-visible {
  background: var(--royal);
  border-color: var(--royal);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-cap-accent {
  background: var(--royal);
  border: 1px solid var(--royal);
  color: var(--white);
  font-weight: 600;
  padding: 0.72rem 1.5rem;
  border-radius: var(--radius);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
  display: inline-block;
}
.btn-cap-accent:hover, .btn-cap-accent:focus-visible {
  background: #0038CC;
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* =========================================================================
   Header / Navegación
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
}

.brand-logo { height: 46px; width: auto; }

.navbar-cap .nav-link {
  font-weight: 600;
  color: var(--ink);
  padding: 0.5rem 1rem !important;
  position: relative;
}
.navbar-cap .nav-link.active,
.navbar-cap .nav-link:hover { color: var(--blue); }
.navbar-cap .nav-link.active::after {
  content: "";
  position: absolute;
  left: 1rem; right: 1rem; bottom: 0.15rem;
  height: 2px;
  background: var(--royal);
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  background: linear-gradient(180deg, var(--blue-pale) 0%, var(--white) 100%);
  padding: 4.5rem 0 3.5rem;
  overflow: hidden;
}

.trust-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.trust-badge .icon-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}

/* =========================================================================
   Carrusel de servicios — banner a todo el ancho (estilo referencia)
   ========================================================================= */
html { overflow-x: hidden; } /* necesario para el truco de ancho completo (100vw) */

.hero-compact { padding: 3rem 0 2.5rem; }

.hero-carousel-wrap {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
}

.service-carousel-full .carousel-slide-full {
  position: relative;
  height: 620px;
  background-size: cover;
  background-position: center;
}
.service-carousel-full .carousel-slide-full::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(11,37,69,0.05) 0%, rgba(11,37,69,0.12) 45%, rgba(11,37,69,0.35) 100%);
}

.slide-caption-panel {
  position: absolute;
  z-index: 2;
  top: 12%;
  right: 6%;
  width: min(420px, 88%);
  background: var(--navy);
  color: var(--white);
  padding: 2.4rem 2.1rem;
  box-shadow: var(--shadow-md);
}
.slide-caption-panel .eyebrow { color: #9DBBE3; }
.slide-caption-panel h3 { color: var(--white); font-size: 1.6rem; line-height: 1.18; margin: 0.6rem 0 1rem; }
.slide-caption-panel p { color: #DCE6F5; margin-bottom: 1.5rem; }

.carousel-floating-tag {
  position: absolute;
  z-index: 3;
  left: 1.5rem; bottom: 1.5rem;
  display: inline-flex; align-items: center; gap: 0.65rem;
  background: var(--white);
  border-radius: 999px;
  padding: 0.4rem 1.1rem 0.4rem 0.4rem;
  box-shadow: var(--shadow-md);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform .18s ease;
}
.carousel-floating-tag:hover { transform: translateY(-2px); color: var(--navy); }
.carousel-floating-tag .cft-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--royal);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 38px;
}

.service-carousel-full .carousel-indicators { z-index: 3; margin-bottom: 1.35rem; }
.service-carousel-full .carousel-indicators [data-bs-target] {
  width: 9px; height: 9px; border-radius: 50%;
  background-color: rgba(255,255,255,0.55);
  opacity: 1;
}
.service-carousel-full .carousel-indicators .active { background-color: var(--royal); }

.service-carousel-full .carousel-control-prev,
.service-carousel-full .carousel-control-next { z-index: 3; width: 7%; opacity: 1; }
.carousel-control-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(11,37,69,0.5);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 1.05rem;
  transition: background .2s ease;
}
.service-carousel-full .carousel-control-prev:hover .carousel-control-icon,
.service-carousel-full .carousel-control-next:hover .carousel-control-icon { background: var(--royal); }

@media (max-width: 767.98px) {
  .service-carousel-full .carousel-slide-full { height: 560px; }
  .slide-caption-panel {
    top: auto; bottom: 0; right: 0; left: 0;
    width: 100%;
    padding: 1.75rem 1.5rem 2.25rem;
  }
  .carousel-floating-tag span:last-child { display: none; }
  .carousel-floating-tag { padding: 0.4rem; }
}

/* =========================================================================
   Grilla de servicios como iconos (servicios.php)
   ========================================================================= */
.service-icon-tile {
  display: block;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.service-icon-tile:hover, .service-icon-tile:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--royal);
}
.service-icon-tile .service-icon-lg {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--royal);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
  transition: background .2s ease, color .2s ease;
}
.service-icon-tile:hover .service-icon-lg { background: var(--royal); color: var(--white); }
.service-icon-tile h3 { color: var(--navy); font-size: 1.1rem; margin-bottom: 0.5rem; }
.service-icon-tile p { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 0; }

/* Página de detalle de servicio */
.service-detail-icon {
  width: 74px; height: 74px;
  border-radius: 18px;
  background: var(--blue-pale);
  color: var(--royal);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem;
}

/* =========================================================================
   Tarjetas de servicio
   ========================================================================= */
.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-light);
}
.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--blue-pale);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}
.service-card .service-num {
  font-family: var(--font-mono);
  color: var(--line);
  font-size: 0.8rem;
  float: right;
}

/* =========================================================================
   Equipo (sin fotos) — avatar con iniciales sobre azul
   ========================================================================= */
.role-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.9rem;
  height: 100%;
}
.role-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  margin-bottom: 1rem;
}

/* =========================================================================
   Sello / certificación
   ========================================================================= */
.seal {
  width: 118px; height: 118px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 0.6rem;
  position: relative;
}
.seal::before {
  content: "";
  position: absolute; inset: 7px;
  border: 1px dashed var(--gold);
  border-radius: 50%;
  opacity: 0.6;
}
.seal span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--navy);
  text-transform: uppercase;
  line-height: 1.35;
}

/* =========================================================================
   Blog / Noticias
   ========================================================================= */
.news-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  background: var(--white);
  transition: box-shadow .2s ease, transform .2s ease;
}
.news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.news-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  background: var(--blue-pale);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  display: inline-block;
}
.ticker-strip {
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.55rem 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  animation: ticker-scroll 26s linear infinite;
}
.ticker-strip span { padding: 0 1.6rem; opacity: 0.9; white-space: nowrap; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* =========================================================================
   Contacto
   ========================================================================= */
.contact-panel {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
}
.contact-panel a { color: #CBDBF2; }
.contact-panel a:hover { color: var(--white); }
.contact-info-row { display: flex; gap: 0.85rem; margin-bottom: 1.15rem; }
.contact-info-row .ci-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
}

.form-control-cap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
}
.form-control-cap:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(46, 125, 209, 0.18);
}

.map-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.map-frame iframe { width: 100%; height: 320px; border: 0; display: block; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  background: var(--navy);
  color: #C7D6EC;
  padding: 3.5rem 0 1.5rem;
}
.site-footer h5 { color: var(--white); font-family: var(--font-body); font-weight: 700; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; }
.site-footer a { color: #C7D6EC; }
.site-footer a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: #9AAFCC;
}

/* =========================================================================
   Botón flotante WhatsApp + Volver arriba
   ========================================================================= */
.float-actions {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  z-index: 1040;
  display: flex; flex-direction: column; gap: 0.75rem;
  align-items: flex-end;
}
.fab {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
  font-size: 1.35rem;
  transition: transform .18s ease, opacity .18s ease;
}
.fab-whatsapp { background: #25D366; }
.fab-whatsapp:hover { transform: scale(1.06); color: #fff; }
.fab-top {
  background: var(--navy);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}
.fab-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.fab-top:hover { background: var(--blue); }

/* =========================================================================
   Reveal on scroll (usado por main.js)
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* =========================================================================
   Accordion / Tabs (ajustes sobre Bootstrap)
   ========================================================================= */
.accordion-cap .accordion-button {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
}
.accordion-cap .accordion-button:not(.collapsed) {
  background: var(--blue-pale);
  color: var(--navy);
  box-shadow: none;
}
.accordion-cap .accordion-button:focus { box-shadow: 0 0 0 3px rgba(46,125,209,0.18); }

.nav-tabs-cap .nav-link {
  color: var(--ink-soft);
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
}
.nav-tabs-cap .nav-link.active {
  color: var(--navy);
  border-color: var(--gold);
  background: transparent;
}

/* Tablas responsive */
.table-cap thead { background: var(--navy); color: var(--white); }
.table-cap td, .table-cap th { vertical-align: middle; }

/* Utilidades legales (páginas de política/términos) */
.legal-page h2 { margin-top: 2.2rem; }
.legal-page { max-width: 860px; }

/* Simple pages (política / términos) header */
.simple-hero {
  background: var(--navy);
  color: var(--white);
  padding: 3.5rem 0 2.5rem;
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
  .balance-card { margin-top: 2.5rem; }
}
