/* ==========================================================================
   Tu Financiera — Hoja de estilos principal
   Diseño corporativo moderno, accesible y responsivo.
   ========================================================================== */

:root {
    --tf-primary: #0d5c63;      /* Verde azulado corporativo */
    --tf-primary-dark: #094449;
    --tf-accent: #f5a623;       /* Dorado/ámbar */
    --tf-dark: #0f1b1d;
    --tf-light: #f5f8f8;
    --tf-text: #243133;
    --bs-primary: var(--tf-primary);
}

* { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--tf-text);
    overflow-x: hidden;
}

/* ---- Utilidades de marca --------------------------------------------------*/
.btn-primary {
    --bs-btn-bg: var(--tf-primary);
    --bs-btn-border-color: var(--tf-primary);
    --bs-btn-hover-bg: var(--tf-primary-dark);
    --bs-btn-hover-border-color: var(--tf-primary-dark);
    --bs-btn-active-bg: var(--tf-primary-dark);
}
.btn-outline-primary {
    --bs-btn-color: var(--tf-primary);
    --bs-btn-border-color: var(--tf-primary);
    --bs-btn-hover-bg: var(--tf-primary);
    --bs-btn-hover-border-color: var(--tf-primary);
}
.text-primary { color: var(--tf-primary) !important; }
.bg-primary { background-color: var(--tf-primary) !important; }
a { color: var(--tf-primary); }

.skip-link {
    position: absolute; left: 1rem; top: 0.5rem; z-index: 2000;
    background: #fff; padding: .5rem 1rem; border-radius: .375rem;
}

/* ---- Cabecera -------------------------------------------------------------*/
.site-header .navbar { transition: box-shadow .2s ease; }
.navbar-nav .nav-link { font-weight: 500; color: var(--tf-text); }
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover { color: var(--tf-primary); }

/* ---- Hero -----------------------------------------------------------------*/
.hero {
    position: relative;
    background: var(--hero-img, none) center/cover no-repeat, linear-gradient(120deg, var(--tf-primary-dark), var(--tf-primary));
    background-blend-mode: overlay;
    min-height: 70vh;
    display: flex;
    align-items: center;
}
.hero__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(120deg, rgba(9,68,73,.92) 0%, rgba(13,92,99,.7) 60%, rgba(13,92,99,.35) 100%);
}

/* ---- Encabezado de páginas internas --------------------------------------*/
.page-header {
    position: relative;
    background: linear-gradient(120deg, var(--tf-primary-dark), var(--tf-primary));
}
.page-header__overlay { position: absolute; inset: 0; opacity: .15;
    background-image: radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ---- Tarjetas -------------------------------------------------------------*/
.service-card { transition: transform .2s ease, box-shadow .2s ease; }
.service-card:hover { transform: translateY(-4px); box-shadow: 0 .75rem 2rem rgba(0,0,0,.08) !important; }
.service-card__icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(13,92,99,.1); color: var(--tf-primary); font-size: 1.6rem;
}

.article-card { transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; }
.article-card:hover { transform: translateY(-4px); box-shadow: 0 .75rem 2rem rgba(0,0,0,.1) !important; }
.article-card__media { display: block; overflow: hidden; }
.article-card__media img { transition: transform .4s ease; object-fit: cover; aspect-ratio: 16/9; }
.article-card:hover .article-card__media img { transform: scale(1.05); }

/* ---- Contenido de artículos ----------------------------------------------*/
.article-content h2 { font-weight: 700; margin-top: 1.75rem; margin-bottom: .75rem; color: var(--tf-primary-dark); }
.article-content h3 { font-weight: 600; margin-top: 1.25rem; margin-bottom: .5rem; }
.article-content p { line-height: 1.8; margin-bottom: 1rem; }
.article-content img { max-width: 100%; height: auto; border-radius: .5rem; }

/* ---- Newsletter -----------------------------------------------------------*/
.newsletter { background: linear-gradient(120deg, var(--tf-primary), var(--tf-primary-dark)); }

/* ---- Pie ------------------------------------------------------------------*/
.footer-link { color: rgba(255,255,255,.7); text-decoration: none; }
.footer-link:hover { color: #fff; }

/* ---- Banner de cookies ----------------------------------------------------*/
.cookie-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080;
    background: rgba(15,27,29,.97); color: #fff; padding: 1rem 0;
    box-shadow: 0 -.5rem 1.5rem rgba(0,0,0,.25);
}
.cookie-banner__inner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-banner__text { flex: 1 1 320px; font-size: .9rem; }
.cookie-banner a { color: var(--tf-accent); }
.cookie-prefs { background: rgba(255,255,255,.06); border-radius: .5rem; padding: 1rem; }

/* ---- Ventana de acceso ----------------------------------------------------*/
.access-gate {
    position: fixed; inset: 0; z-index: 2000;
    background: linear-gradient(120deg, rgba(9,68,73,.97), rgba(15,27,29,.97));
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.access-gate[hidden],
html.tf-granted .access-gate { display: none; }
.access-gate__card {
    background: #fff; border-radius: 1rem; max-width: 520px; width: 100%;
    padding: 2.5rem 2rem; text-align: center; box-shadow: 0 1.5rem 3rem rgba(0,0,0,.3);
    animation: gateIn .35s ease;
}
@keyframes gateIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
body.gate-open { overflow: hidden; }

/* ---- Responsive -----------------------------------------------------------*/
@media (max-width: 991.98px) {
    .hero { min-height: 60vh; }
    .navbar-nav { padding-top: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto; }
    .article-card, .service-card, .article-card__media img { transition: none; }
}
