:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --border: #e2e8f0;
    --primary: #0f4c81;        /* Azul financiero confiable */
    --primary-hover: #0a365c;
    --accent: #059669;         /* Verde esmeralda para resultados */
    --accent-soft: #ecfdf5;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --max-width: 1120px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header y Navegación */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.9rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.brand span {
    color: var(--accent);
}

.brand:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    text-decoration: none;
}

/* Contenedor principal */
main {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem 3.5rem;
}

/* Hero de portada */
.hero {
    text-align: center;
    max-width: 740px;
    margin: 0 auto 2rem;
}

.hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.hero p {
    color: var(--muted);
    font-size: 1.05rem;
}

/* Espacios de anuncios AdSense (Anti-CLS) */
.ad-slot {
    width: 100%;
    margin: 1.75rem auto;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    overflow: hidden;
}

.ad-slot--banner {
    min-height: 100px;
}

.ad-slot--rect {
    min-height: 250px;
}

/* Títulos de sección y cuadrícula de tarjetas */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2.25rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.25rem;
}

.calc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calc-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    text-decoration: none;
}

.calc-card .badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary);
    margin-bottom: 0.75rem;
    width: fit-content;
}

.calc-card h3 {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 0.45rem;
}

.calc-card p {
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.calc-card .cta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

/* Layout interno de cada calculadora (2 columnas) */
.calc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.result-panel {
    background: var(--accent-soft);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 1.75rem;
}

.result-highlight {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    margin: 0.25rem 0 1rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(5, 150, 105, 0.15);
    font-size: 0.95rem;
}

.result-row:last-child {
    border-bottom: none;
}

/* Formularios */
.form-group {
    margin-bottom: 1.15rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}

input[type="number"],
input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

.btn-primary {
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Bloques de contenido SEO y FAQ */
.seo-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
}

.seo-content h2 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p,
.seo-content li {
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.seo-content ul,
.seo-content ol {
    padding-left: 1.35rem;
    margin-bottom: 1rem;
}

details {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.75rem;
    background: #fff;
}

summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}

details p {
    margin-top: 0.65rem;
    margin-bottom: 0;
}

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 1.25rem;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.footer-links a {
    color: var(--muted);
}

@media (max-width: 768px) {
    .calc-layout {
        grid-template-columns: 1fr;
    }
    .nav-links {
        gap: 1rem;
        font-size: 0.88rem;
    }
    .seo-content {
        padding: 1.35rem;
    }
}