/*
 * DINEROZA DESIGN SYSTEM v2
 * Full-site design polish: typography, colors, spacing, visual hierarchy
 * Loaded after page-specific embedded styles — safely overrides via specificity
 *
 * Goals: premium-financial, trustworthy, clean, scannable — NOT cluttered
 */

/* ===== NEW FONT: DM Sans ===== */
/* Replaces Syne (wide/expanded) — DM Sans is sharp, geometric, premium-fintech */
/* @import removed — DM Sans is now loaded via <link> in HTML head to eliminate cascade waterfall */

/* ===== CSS VARIABLE REFINEMENTS ===== */
:root {
    /* Richer emerald — slightly more vibrant, better contrast */
    --emerald: #065F46;
    --emerald-light: #047857;
    --emerald-mid: #059669;
    --emerald-dark: #064E3B;

    /* Deeper gold — more premium, less neon */
    --gold: #D97706;
    --gold-soft: #F59E0B;
    --gold-pale: #FDE68A;

    /* Backgrounds — cleaner hierarchy */
    --cream: #F0FDF9;          /* Cool green-tinted cream, more premium */
    --warm-white: #F9FAFB;     /* Near-white with no color cast */
    --light-gray: #F3F4F6;     /* Clean neutral light bg */
    --surface: #FFFFFF;
    --surface-hover: #F6FEF9;  /* Very subtle green tint on hover */

    /* Text — slightly bluer-neutral for legibility */
    --dark: #111827;
    --dark-secondary: #1F2937;
    --gray: #6B7280;
    --gray-light: #9CA3AF;

    /* Border — cleaner */
    --border: rgba(6, 95, 70, 0.12);
    --border-light: rgba(6, 95, 70, 0.07);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 8px rgba(6, 95, 70, 0.06);
    --shadow-md: 0 4px 16px rgba(6, 95, 70, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 40px rgba(6, 95, 70, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 16px 48px rgba(6, 95, 70, 0.14), 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* ===== TYPOGRAPHY OVERRIDES: Syne → DM Sans ===== */
/* Applied with !important to override page-level embedded styles */

.syne,
.logo,
footer .footer-logo,
h1,
h2,
h3,
.hero h1,
.page-header h1,
.section-header h2,
.guides-header h2,
.faq-section h2,
.guide-section h2,
.article-body h2,
.article-body h3,
.article-card h2,
.guide-card h2,
.guide-box h3,
.tile-name,
.pop-name,
.pop-stat,
.trust-num,
.footer-col h4,
.card-header-info h3,
.cta-box h3,
.cta-text h3,
.faq-item h3,
.price-value,
.provider-name,
.section-title,
.stat-value,
.calc-example h4,
.info-box h4,
.save-tip h4,
.empty-state h3,
.required-table thead th,
.comparison-header h1,
.comparison-header h2,
.page-hero h1,
.table-section h2,
.modal-title,
.tab-title {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Typography rhythm & spacing */
h1 {
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h2 {
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h3 {
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.logo,
footer .footer-logo {
    letter-spacing: -0.04em !important;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(160deg, #ECFDF9 0%, #F0FDF4 35%, #FAFFFE 65%, #ffffff 100%);
}

/* Stronger hero eyebrow pill */
.hero-eyebrow {
    background: rgba(6, 95, 70, 0.09);
    border: 1px solid rgba(6, 95, 70, 0.14);
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    font-weight: 700;
}

/* Hero heading: better weight + spacing */
.hero h1 {
    letter-spacing: -0.035em !important;
    line-height: 1.05 !important;
    font-weight: 800 !important;
}

/* Hero subtitle more legible */
.hero-sub {
    color: #4B5563;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ===== NAVIGATION ===== */
.nav-wrapper {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(6, 95, 70, 0.08), 0 2px 12px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(6, 95, 70, 0.08);
}

/* ── Desktop sticky header & nav spacing fix ──────────────────────────────
   Prevents nav items cramping together at 1024–1440px viewports.
   Overrides per-page embedded styles (loads last, same specificity → wins).
*/
@media (min-width: 769px) {
    /* Sticky header for non-wrapper pages (most inner pages use bare <header>) */
    header {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        background: rgba(255, 255, 255, 0.97) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        box-shadow: 0 1px 0 rgba(6, 95, 70, 0.08), 0 2px 12px rgba(0, 0, 0, 0.04) !important;
        border-bottom: 1px solid rgba(6, 95, 70, 0.08) !important;
    }
    /* Also make bare <nav> sticky for pages without <header> wrapper */
    .nav-wrapper {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
    }
    /* Tighten nav-links gap so 11 items fit cleanly at 1024–1200px */
    .nav-links {
        gap: 0.3rem !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
    }
    /* Consistent padding on nav items for clean click targets */
    .nav-links > a,
    .nav-links > .nav-item > a,
    .nav-links > li > a {
        padding: 0.375rem 0.5rem !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
    }
    /* Fix injected <li> elements to display correctly in flex nav */
    .nav-links > li {
        list-style: none !important;
        display: flex !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

.nav-links a {
    font-size: 0.83rem !important;
    font-weight: 500;
    color: #4B5563;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.nav-links a:hover {
    color: var(--emerald);
    background: rgba(6, 95, 70, 0.07);
}

/* Active nav item — highlights the current section */
.nav-links a.active {
    color: var(--gold) !important;
    font-weight: 700 !important;
}

/* ===== SEARCH BAR ===== */
.search-wrap input {
    border: 1.5px solid rgba(6, 95, 70, 0.14);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(6, 95, 70, 0.05);
    font-size: 0.975rem;
}

.search-wrap input:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(6, 95, 70, 0.1), 0 2px 8px rgba(6, 95, 70, 0.06);
}

.search-btn {
    background: linear-gradient(135deg, var(--emerald-dark) 0%, var(--emerald) 100%);
    box-shadow: 0 2px 8px rgba(6, 95, 70, 0.25);
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-mid) 100%);
    box-shadow: 0 4px 14px rgba(6, 95, 70, 0.32);
    transform: translateY(-1px);
}

/* ===== QUICK PILLS ===== */
.quick-pill {
    background: rgba(6, 95, 70, 0.06);
    border: 1px solid rgba(6, 95, 70, 0.1);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.18s ease;
}

.quick-pill:hover {
    background: var(--emerald);
    border-color: var(--emerald);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.22);
}

/* ===== CATEGORY TILES ===== */
.tile {
    border: 1.5px solid var(--border-light);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    background: #fff;
    transition: all 0.22s ease;
}

.tile:hover {
    border-color: rgba(6, 95, 70, 0.28);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.tile-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em !important;
}

.tile-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #6B7280;
}

.tile-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--emerald);
}

/* ===== POPULAR CARDS ===== */
.popular {
    background: linear-gradient(180deg, #F0FDF9 0%, #E8FDF5 100%);
}

.popular-card {
    border: 1.5px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    background: #fff;
    transition: all 0.2s ease;
}

.popular-card:hover {
    border-color: rgba(6, 95, 70, 0.25);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.pop-stat {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.025em !important;
    color: var(--emerald);
}

.pop-stat-label {
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 400;
}

/* ===== TRUST SIGNALS ===== */
.trust-grid {
    background: linear-gradient(135deg, #064E3B 0%, var(--emerald) 55%, var(--emerald-mid) 100%);
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(6, 78, 59, 0.2);
}

.trust-num {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em !important;
    color: var(--gold-pale);
}

.trust-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.45;
    font-weight: 500;
}

/* ===== GUIDES / ARTICLES ===== */
.guides {
    background: #F6FDFB;
}

.guide-row {
    background: #fff;
    border-radius: 12px;
    border: 1.5px solid var(--border-light);
    transition: all 0.16s ease;
    box-shadow: 0 1px 4px rgba(6, 95, 70, 0.04);
}

.guide-row:hover {
    border-color: rgba(6, 95, 70, 0.25);
    box-shadow: 0 6px 20px rgba(6, 95, 70, 0.09);
    transform: translateX(3px);
}

/* ===== SECTION HEADERS ===== */
.section-header h2,
.guides-header h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.1rem);
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.03em !important;
}

.section-header p {
    color: #6B7280;
    font-size: 0.9rem;
    margin-top: 0.4rem;
    line-height: 1.6;
}

/* ===== FOOTER ===== */
footer {
    background: #0F1B15;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.82rem;
    line-height: 1.65;
}

.footer-col h4 {
    font-size: 0.72rem !important;
    letter-spacing: 0.1em !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
}

.footer-col a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 2.1;
    transition: color 0.15s;
}

.footer-col a:hover {
    color: var(--gold-soft);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.22);
    font-size: 0.74rem;
}

/* ===== COMPARISON / INNER PAGES ===== */

/* Page hero headers (tarjetas, remesas, etc.) */
.page-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.035em !important;
    line-height: 1.08 !important;
}

/* Provider cards */
.provider-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em !important;
    color: var(--dark);
}

.price-value {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.025em !important;
    color: var(--emerald);
}

/* CTA boxes */
.cta-box,
.cta-section {
    background: linear-gradient(135deg, #064E3B 0%, var(--emerald) 60%, var(--emerald-mid) 100%);
}

.cta-box h3,
.cta-text h3 {
    font-weight: 800;
    letter-spacing: -0.025em !important;
}

/* Force readable white text inside dark green CTA banners — overrides .article-body p */
.cta-box p,
.cta-section p {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* FAQ */
.faq-section h2 {
    font-weight: 800;
    letter-spacing: -0.03em !important;
}

.faq-item h3 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em !important;
    line-height: 1.4;
}

/* Info boxes */
.tip-box,
.info-box {
    border-radius: 12px;
}

.info-box h4,
.save-tip h4,
.calc-example h4,
.guide-box h3 {
    font-weight: 700;
    letter-spacing: -0.015em !important;
}

/* ===== TABLE STYLES ===== */
.required-table thead th {
    background: linear-gradient(135deg, #064E3B 0%, var(--emerald) 100%);
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em !important;
    padding: 0.9rem 1rem;
}

/* ===== STAT VALUES ===== */
.stat-value {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em !important;
    color: var(--emerald);
}

/* ===== ARTICLE PAGES ===== */
.article-wrap {
    background: #fff;
    border-radius: 0;
}

.article-body {
    line-height: 1.82;
    color: #374151;
}

.article-body h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--emerald);
    margin: 2.75rem 0 0.875rem;
    letter-spacing: -0.025em !important;
}

.article-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin: 2rem 0 0.5rem;
    letter-spacing: -0.02em !important;
}

.article-body p {
    color: #374151;
    margin-bottom: 1.1rem;
    font-size: 1rem;
}

.tip-box {
    background: rgba(6, 95, 70, 0.05);
    border-left: 4px solid var(--emerald);
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.35rem;
    margin: 1.75rem 0;
}

/* Card review boxes in articles */
.card-review {
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem;
    margin: 2.25rem 0;
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.card-header-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em !important;
    color: var(--emerald);
    line-height: 1.2;
}

/* ===== SECTION TITLE (tarjetas page header bar) ===== */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em !important;
    color: var(--emerald);
}

/* ===== GUIDE PAGE CARDS ===== */
.guide-card h2,
.article-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em !important;
    color: var(--emerald);
}

/* ===== EMPTY STATE ===== */
.empty-state h3 {
    font-weight: 700;
    letter-spacing: -0.02em !important;
    color: var(--emerald);
}

/* ===== GENERAL BUTTON REFINEMENTS ===== */
button,
.btn,
[class*="btn-"] {
    font-family: 'DM Sans', -apple-system, sans-serif !important;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ===== MOBILE CTA SPACING (touch targets) ===== */
/*
 * Minimum 44px touch targets and clear visual separation between adjacent
 * interactive elements. Applies sitewide to prevent fat-finger tap conflicts.
 */

/* Editorial meta below page headers */
.editorial-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #6B7280;
}

.editorial-byline { font-weight: 600; }
.editorial-sep { color: #9CA3AF; }
.editorial-date {}

/* Card CTA section: stack button + review link vertically on mobile */
@media (max-width: 900px) {
    .card-cta,
    .mortgage-cta-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }

    /* Review/secondary link: ensure adequate touch target height */
    .review-link {
        min-height: 36px !important;
        display: flex !important;
        align-items: center !important;
        padding: 4px 0 !important;
    }

    /* Inline table CTAs: ensure min touch size */
    .table-cta {
        min-height: 36px;
        display: inline-flex !important;
        align-items: center !important;
    }
}

@media (max-width: 600px) {
    /* Full-width primary CTAs on small screens */
    .card-cta .cta-btn,
    .cta-bottom .cta-btn {
        width: 100% !important;
        text-align: center !important;
    }

    /* CTA buttons in flex row containers should wrap and spread */
    .cta-buttons,
    .hero-cta {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .cta-buttons .btn-primary,
    .cta-buttons .btn-secondary,
    .cta-buttons .cta-btn-primary,
    .cta-buttons .cta-btn-secondary {
        text-align: center !important;
        width: 100% !important;
    }
}

/* ===== RESPONSIVE POLISH ===== */
@media (max-width: 768px) {
    .hero h1 {
        letter-spacing: -0.025em !important;
        line-height: 1.08 !important;
    }

    .section-header h2,
    .guides-header h2 {
        letter-spacing: -0.025em !important;
    }

    .trust-grid {
        border-radius: 18px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        letter-spacing: -0.02em !important;
    }
}

/* ===== TAX SEASON BANNER 2026 ===== */
.tax-season-banner {
    background: linear-gradient(135deg, #065F46 0%, #047857 100%);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tax-season-banner .tsb-content {
    flex: 1;
    min-width: 200px;
}

.tax-season-banner .tsb-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #FCD34D;
    margin-bottom: 0.35rem;
}

.tax-season-banner h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.3rem;
    letter-spacing: -0.02em;
}

.tax-season-banner p {
    font-size: 0.87rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.tsb-actions {
    display: flex;
    gap: 0.625rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
}

.tsb-btn-primary {
    background: #FCD34D;
    color: #1C1917;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    transition: opacity 0.15s;
    border: none;
}

.tsb-btn-primary:hover {
    opacity: 0.9;
    text-decoration: none;
    color: #1C1917;
}

.tsb-btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    transition: background 0.15s;
}

.tsb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    text-decoration: none;
    color: #fff;
}

.tax-season-banner-wrap {
    padding: 0 2rem;
}

@media (max-width: 640px) {
    .tax-season-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.25rem;
        margin: 1.25rem 0;
    }
    .tax-season-banner-wrap {
        padding: 0 1rem;
    }
    .tsb-actions {
        width: 100%;
    }
    .tsb-btn-primary,
    .tsb-btn-secondary {
        flex: 1 1 0;
        text-align: center;
        min-width: 0;
    }
}
