/* ═══════════════════════════════════════════════
   FinanzasVivienda — base.css
   Estilos compartidos entre todas las páginas:
   variables, reset, tipografía, nav, footer,
   cookie banner y utilidades de contenedor.
   ═══════════════════════════════════════════════ */

/* ─── Variables ─── */
:root {
  /* Paleta */
  --bg:          #F4F2ED;
  --bg-card:     #FFFFFF;
  --bg-input:    #F9F8F5;
  --text:        #1B1F23;
  --text-2:      #3D434D;
  --text-3:      #6B7280;
  --accent:      #1A6B50;
  --accent-soft: #E6F3EC;
  --accent-2:    #C2652A;
  --accent-2-soft: #FDF0E8;
  --border:      #DDD9D2;
  --border-2:    #ECEAE5;

  /* Tipografía */
  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'Outfit', system-ui, sans-serif;

  /* Forma */
  --radius:    20px;
  --radius-sm: 12px;

  /* Sombras */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.03), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-2: 0 4px 24px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Contenedores */
  --w-max:    1100px;
  --w-narrow: 720px;
  --w-wide:   1280px;
}

/* ─── Reset + base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Grain texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 200px;
}

a { color: inherit; text-decoration: none; }

/* ─── Tipografía base ─── */
h1 { font-family: var(--serif); font-weight: 400; line-height: 1.12; }
h2 { font-family: var(--serif); font-weight: 400; line-height: 1.2; }

/* ─── Contenedores ─── */
.container       { max-width: var(--w-max);    margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: var(--w-narrow); margin: 0 auto; padding: 0 1.5rem; }
.container-wide   { max-width: var(--w-wide);   margin: 0 auto; padding: 0 1.5rem; }

/* ─── Tool Nav ─── */
.tool-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 242, 237, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.tool-nav-inner {
  display: flex;
  align-items: center;
  max-width: var(--w-max);
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 1rem;
}

.tool-nav-inner::-webkit-scrollbar { display: none; }

.tool-nav-brand {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.7rem 0.875rem 0.7rem 0.25rem;
  margin-right: 0.25rem;
  border-right: 1px solid var(--border);
}

/* Insignia "Paso N de 6" */
.tn-step {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 0.2rem 0.5rem;
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
  margin-right: 0.25rem;
}

/* Links de nav — ocultos en mobile por defecto */
.tool-nav a.tn-link {
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  padding: 0.7rem 0.6rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  display: none;
}

.tool-nav a.tn-link:hover { color: var(--text); }
.tool-nav a.tn-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Burger — visible en mobile */
.tn-burger {
  display: flex;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0.5rem;
  margin-left: auto;
  cursor: pointer;
  color: var(--text);
}

/* ─── Menú mobile overlay ─── */
.tn-mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 999;
  background: rgba(244,242,237,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}

.tn-mobile-menu.open { display: flex; }

.tn-mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.tn-mobile-top a {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.tn-close {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-3);
}

.tn-mobile-menu a.tn-mob-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--border-2);
  transition: color 0.15s;
}

.tn-mobile-menu a.tn-mob-link:last-child { border-bottom: none; }
.tn-mobile-menu a.tn-mob-link:hover { color: var(--accent); }
.tn-mobile-menu a.tn-mob-link.mob-active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  border-radius: 10px;
  border-bottom-color: transparent;
}

.tn-mob-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--border-2);
  color: var(--text-3);
  flex-shrink: 0;
}

.tn-mob-link.mob-active .tn-mob-num {
  background: var(--accent);
  color: #fff;
}

/* Desktop: mostrar links, ocultar burger */
@media (min-width: 641px) {
  .tool-nav a.tn-link { display: inline-flex; }
  .tn-burger { display: none; }
}

/* ─── Site Footer ─── */
.site-footer {
  background: var(--text);  /* #1B1F23 */
  color: #fff;
  padding: 2.5rem 1.5rem 1.5rem;
  font-family: var(--sans);
  margin-top: 3rem;
}

.site-footer-inner {
  max-width: var(--w-max);
  margin: 0 auto;
}

.site-footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.site-footer-brand p:first-child {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.site-footer-brand p:last-child {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  max-width: 320px;
  line-height: 1.5;
}

.site-footer-links {
  display: flex;
  gap: 2rem;
  font-size: 0.8rem;
}

.site-footer-col h4 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
}

.site-footer-col a {
  display: block;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.35rem;
  transition: color 0.15s;
}

.site-footer-col a:hover { color: #fff; }

.site-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

/* ─── Cookie Banner ─── */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--text);
  color: #fff;
  padding: 1rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
}

.cookie-banner-inner {
  max-width: var(--w-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-banner p {
  flex: 1;
  min-width: 200px;
  line-height: 1.5;
  margin: 0;
}

.cookie-banner p a { color: #98D4B8; text-decoration: underline; }

.cookie-banner-btns { display: flex; gap: 0.5rem; flex-shrink: 0; }

.cookie-banner .btn-accept {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
}

.cookie-banner .btn-reject {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--sans);
}

/* ─── Shared page header (herramientas y guías) ─── */
.page-header {
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1.5rem clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
}

.page-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  font-size: clamp(1.85rem, 4.5vw, 2.8rem);
  margin-bottom: 0.85rem;
}

.page-header h1 em { font-style: italic; color: var(--accent); }

.page-header p {
  font-size: 1rem;
  color: var(--text-2);
  font-weight: 300;
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto;
}
