/* ==========================================================================
   TuBreli — Educación, Asesoría y Acompañamiento Financiero
   Hoja de estilos global
   ========================================================================== */

:root {
  --navy: #0e2447;
  --navy-2: #16325e;
  --navy-3: #1d3f77;
  --gold: #c9a227;
  --gold-2: #e0b83a;
  --gold-soft: #f7efd8;
  --ink: #1c2b3a;
  --muted: #5a6b7d;
  --line: #e6ebf1;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --bg-tint: #eef3f9;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 34px rgba(14, 36, 71, 0.10);
  --shadow-lg: 0 24px 60px rgba(14, 36, 71, 0.16);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Georgia", "Times New Roman", serif;
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { color: var(--gold); }
ul { list-style: none; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; font-weight: 800; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; }
p { color: var(--muted); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ==========================================================================
   Pantalla de carga
   ========================================================================== */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  transition: opacity .45s ease, visibility .45s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#loader .loader-logo { width: 78px; height: 78px; animation: pulseLogo 1.6s ease-in-out infinite; }
#loader .loader-bar { width: 180px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; }
#loader .loader-bar span { display: block; height: 100%; width: 40%; background: var(--gold); border-radius: 4px; animation: slideBar 1.1s ease-in-out infinite; }
#loader .loader-title { color: #fff; font-weight: 700; letter-spacing: 2px; font-size: .85rem; opacity: .9; }
@keyframes pulseLogo { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes slideBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

/* ==========================================================================
   Barra superior (marquesina) — fija, no desaparece
   ========================================================================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  background: var(--navy);
  overflow: hidden; height: 40px;
  display: flex; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar-track {
  display: flex; white-space: nowrap;
  animation: marquee 32s linear infinite;
}
.topbar-track span {
  color: #dce6f5; font-size: .82rem; font-weight: 500;
  padding-right: 46px; letter-spacing: .2px;
}
.topbar-track b { color: var(--gold-2); font-weight: 700; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ==========================================================================
   Header / navegación
   ========================================================================== */
header {
  position: sticky; top: 40px; z-index: 80;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s ease;
}
header.scrolled { box-shadow: 0 6px 24px rgba(14,36,71,.08); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand img { width: 46px; height: 46px; }
.brand .brand-name { font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: -.5px; }
.brand .brand-name span { color: var(--gold); }
.brand .brand-tag { font-size: .62rem; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; display: block; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 9px 13px; border-radius: 8px; font-weight: 600; font-size: .93rem; color: var(--ink);
  transition: background .2s, color .2s;
}
.nav-links a:hover { background: var(--bg-tint); color: var(--navy); }
.nav-links a.active { color: var(--gold); }
.nav-links .btn-cta { background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; }
.nav-links .btn-cta:hover { background: var(--navy-3); color: #fff; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--navy); border-radius: 3px; transition: .3s; }

/* ==========================================================================
   Botones
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px; border-radius: 12px; font-weight: 700; font-size: .95rem;
  border: none; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 8px 22px rgba(14,36,71,.22); }
.btn-primary:hover { background: var(--navy-3); color: #fff; transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 8px 22px rgba(201,162,39,.28); }
.btn-gold:hover { background: var(--gold-2); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--gold-soft); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 55%, #2a5aa8 100%);
  color: #fff; overflow: hidden;
  padding: 90px 0 100px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(224,184,58,.14) 0, transparent 40%),
                    radial-gradient(circle at 80% 80%, rgba(255,255,255,.08) 0, transparent 45%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  padding: 7px 14px; border-radius: 40px; font-size: .8rem; font-weight: 600; color: var(--gold-2);
  margin-bottom: 20px;
}
.hero h1 { color: #fff; margin-bottom: 20px; }
.hero h1 span { color: var(--gold-2); }
.hero p.lead { color: #d7e2f2; font-size: 1.12rem; max-width: 560px; margin-bottom: 28px; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .hero-art { position: relative; }
.hero .hero-img { border-radius: 20px; box-shadow: var(--shadow-lg); }
.hero .badge-float {
  position: absolute; background: #fff; color: var(--navy); border-radius: 14px;
  padding: 14px 18px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center;
}
.hero .badge-float .num { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.hero .badge-float small { display: block; color: var(--muted); font-size: .78rem; }
.hero .badge-1 { top: -18px; left: -22px; }
.hero .badge-2 { bottom: -20px; right: -14px; }

/* Nota de advertencia (no inversiones) */
.disclaimer {
  position: relative; z-index: 2;
  background: var(--gold-soft); border: 1px solid #e9d9a8; color: #7a5d12;
  border-radius: 14px; padding: 16px 22px; margin-top: 40px;
  display: flex; gap: 14px; align-items: flex-start; font-size: .95rem; font-weight: 500;
}
.disclaimer .ico { font-size: 1.4rem; flex-shrink: 0; }

/* ==========================================================================
   Secciones generales
   ========================================================================== */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 52px; }
.section-head .eyebrow {
  display: inline-block; color: var(--gold); font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; font-size: .78rem; margin-bottom: 12px;
}
.section-head p { font-size: 1.05rem; }

/* Grids */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card .card-ico {
  width: 58px; height: 58px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-tint); margin-bottom: 18px;
}
.card .card-ico svg { width: 30px; height: 30px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: .95rem; }
.card .link-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-weight: 700; font-size: .9rem; color: var(--navy); }
.card .link-more:hover { color: var(--gold); }

/* Feature split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split .img-wrap { position: relative; }
.split .img-wrap img { border-radius: 20px; box-shadow: var(--shadow-lg); }
.split ul.check { margin-top: 6px; }
.split ul.check li {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; color: var(--ink); font-weight: 500;
}
.split ul.check li::before { content: "✓"; color: var(--gold); font-weight: 800; }

/* Números / stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat { text-align: center; padding: 26px 12px; }
.stat .num { font-size: 2.4rem; font-weight: 800; color: var(--navy); }
.stat .num span { color: var(--gold); }
.stat .label { color: var(--muted); font-size: .9rem; }

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--navy), var(--navy-3));
  border-radius: 22px; padding: 56px 46px; color: #fff; text-align: center; position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #d7e2f2; max-width: 620px; margin: 0 auto 26px; }
.cta-band .btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   Página interior (encabezado)
   ========================================================================== */
.page-hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: #fff; padding: 70px 0 60px; position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  border: 40px solid rgba(255,255,255,.06); border-radius: 50%;
}
.page-hero h1 { color: #fff; margin-bottom: 12px; }
.page-hero p { color: #d7e2f2; max-width: 680px; }
.page-hero .crumbs { font-size: .85rem; color: #aebcd4; margin-bottom: 14px; }
.page-hero .crumbs a { color: var(--gold-2); }

/* ==========================================================================
   Contenido legal / artículos
   ========================================================================== */
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { margin-top: 40px; padding-bottom: 10px; border-bottom: 2px solid var(--gold-soft); }
.prose h3 { margin-top: 26px; color: var(--navy-3); }
.prose p, .prose li { color: var(--muted); margin-bottom: 14px; }
.prose ul { list-style: disc; padding-left: 22px; margin-bottom: 16px; }
.prose ul li { margin-bottom: 8px; }
.prose .toc {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 20px;
}
.prose .toc ul { list-style: none; padding-left: 0; }
.prose .toc a { display: block; padding: 6px 0; font-weight: 600; }
.prose blockquote {
  border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 16px 20px;
  border-radius: 0 10px 10px 0; margin: 20px 0; color: #6b5410; font-weight: 500;
}

/* ==========================================================================
   Formulario de contacto
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: var(--font); font-size: .95rem; color: var(--ink); background: var(--bg-soft);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,162,39,.14); background: #fff;
}
.field textarea { resize: vertical; min-height: 120px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.field.check { display: flex; gap: 10px; align-items: flex-start; }
.field.check input { width: auto; margin-top: 4px; }
.field.check label { margin-bottom: 0; font-weight: 500; color: var(--muted); font-size: .88rem; }

.form-ok {
  display: none; background: #e8f5ec; border: 1px solid #bfe3cc; color: #1d6b3a;
  padding: 16px 18px; border-radius: 10px; margin-bottom: 18px; font-weight: 600;
}

.info-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 34px; }
.info-card h3 { color: #fff; margin-bottom: 18px; }
.info-card .info-item { display: flex; gap: 14px; margin-bottom: 22px; align-items: flex-start; }
.info-card .info-item .ico { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.info-card .info-item .ico svg { width: 22px; height: 22px; }
.info-card .info-item b { display: block; color: var(--gold-2); font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.info-card .info-item span { color: #d7e2f2; font-size: .92rem; }

.map-wrap { margin-top: 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 360px; }

/* ==========================================================================
   Footer
   ========================================================================== */
footer { background: var(--navy); color: #c3d0e3; padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; }
.footer-grid a { color: #c3d0e3; display: block; padding: 5px 0; font-size: .92rem; }
.footer-grid a:hover { color: var(--gold-2); }
.footer-brand .brand { margin-bottom: 16px; }
.footer-brand p { color: #aebcd4; font-size: .92rem; }
.social { display: flex; gap: 12px; margin-top: 18px; }
.social a {
  width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; transition: background .2s, transform .2s;
}
.social a:hover { background: var(--gold); transform: translateY(-3px); }
.social svg { width: 20px; height: 20px; fill: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; font-size: .82rem; color: #93a5bd;
}
.footer-bottom a { color: #93a5bd; }
.footer-bottom a:hover { color: var(--gold-2); }

/* ==========================================================================
   Botón WhatsApp flotante
   ========================================================================== */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 95;
  width: 60px; height: 60px; border-radius: 50%; background: #25d366;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(37,211,102,.4);
  transition: transform .25s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; fill: #fff; }
.wa-float::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #25d366; animation: waPulse 1.8s ease-out infinite;
}
@keyframes waPulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* ==========================================================================
   Banner de cookies
   ========================================================================== */
.cookie-banner {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 120;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  max-width: 640px; width: calc(100% - 40px); padding: 22px 24px;
  display: none; align-items: flex-start; gap: 16px;
}
.cookie-banner.show { display: flex; animation: slideUp .4s ease; }
.cookie-banner .ck-ico { font-size: 1.8rem; flex-shrink: 0; }
.cookie-banner p { font-size: .88rem; margin-bottom: 14px; }
.cookie-banner p b { color: var(--navy); }
.cookie-banner .ck-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner .ck-btns .btn { padding: 10px 18px; font-size: .85rem; }
@keyframes slideUp { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .hero .wrap, .split, .contact-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 70px 0 80px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 116px; right: 0; left: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 16px 22px 24px;
    box-shadow: var(--shadow-lg); gap: 6px;
    transform: translateY(-20px); opacity: 0; pointer-events: none; transition: .3s;
    border-bottom: 2px solid var(--gold);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 13px 14px; border-radius: 10px; border-bottom: 1px solid var(--line); }
  .nav-links .btn-cta { text-align: center; margin-top: 8px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero .badge-float { display: none; }
  .cta-band { padding: 40px 22px; }
}