/* /trabaja-con-nosotros/afiliados/ — usa los tokens --dc-* de /site-theme.css */

.af {
    background: var(--dc-bg);
    padding: calc(72px + clamp(2rem, 5vw, 3.5rem)) 0 clamp(3rem, 7vw, 5rem);
    color: var(--dc-body);
    font-family: var(--dc-sans);
}
.af section { padding: 0; }
.af-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}
@media (min-width: 720px) { .af-wrap { padding: 0 32px; } }

.af a { color: var(--dc-primary); }
.af h1, .af h2, .af h3 { color: var(--dc-fg); font-family: var(--dc-sans); margin: 0; }
.af p { margin: 0 0 1rem; line-height: 1.65; color: var(--dc-body); }

.af-crumb {
    font-family: var(--dc-mono);
    font-size: 12px;
    color: var(--dc-subtle);
    margin-bottom: 2rem;
}
.af-crumb a { color: var(--dc-muted-fg); text-decoration: none; }
.af-crumb a:hover { text-decoration: underline; }

.af-eyebrow {
    font-family: var(--dc-mono);
    font-size: 12px !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--dc-subtle) !important;
    margin: 0 0 .9rem !important;
}
.af-hl { color: var(--dc-primary); }

/* Hero */
.af-hero { padding-bottom: clamp(2rem, 5vw, 3rem); }
.af-hero h1 {
    font-weight: 300;
    font-size: clamp(2.1rem, 5.2vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -.035em;
    max-width: 16ch;
    margin-bottom: 1.25rem;
}
.af-lead { font-size: clamp(1.02rem, 1.6vw, 1.15rem); max-width: 60ch; }

.af-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.5rem; }
.af-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 3px;
    border: 1px solid var(--dc-border);
    background: var(--dc-card);
    color: var(--dc-fg) !important;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none !important;
    transition: background .15s, border-color .15s;
}
.af-btn:hover { background: var(--dc-hover); }
.af-btn--primary { background: var(--dc-primary); border-color: var(--dc-primary); color: #fff !important; }
.af-btn--primary:hover { background: var(--dc-primary-dark); }

/* Lattice: celdas unidas por 1px */
.af-lattice {
    display: grid;
    gap: 1px;
    background: var(--dc-border);
    border: 1px solid var(--dc-border);
    margin: 1.5rem 0;
}
.af-lattice--2, .af-lattice--3 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
    .af-lattice--2 { grid-template-columns: repeat(2, 1fr); }
    .af-lattice--3 { grid-template-columns: repeat(3, 1fr); }
}
.af-cell { background: var(--dc-card); padding: 22px 22px 18px; }
.af-cell p { margin: 0; font-size: 15px; }
.af-k {
    display: block;
    font-family: var(--dc-mono);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--dc-muted-fg);
    margin-bottom: .6rem;
}
.af-cell strong {
    display: block;
    font-weight: 300;
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    letter-spacing: -.025em;
    color: var(--dc-fg);
    margin-bottom: .5rem;
    line-height: 1.15;
}
.af-stats { margin-top: 0; }

/* Secciones */
.af-sec {
    border-top: 1px solid var(--dc-border);
    padding: clamp(2.5rem, 6vw, 4rem) 0 !important;
}
.af-sec h2 {
    font-weight: 300;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -.03em;
    max-width: 24ch;
    margin-bottom: 1.25rem;
}
.af-sec h3 {
    font-weight: 500;
    font-size: 1.15rem;
    letter-spacing: -.015em;
    margin: 2.25rem 0 .5rem;
}
.af-sec > p { max-width: 70ch; }
.af-note { font-size: 13.5px !important; color: var(--dc-muted-fg) !important; max-width: 80ch; }

/* Tablas */
.af-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--dc-border);
    background: var(--dc-card);
    margin: 1.25rem 0 .9rem;
    -webkit-overflow-scrolling: touch;
}
.af-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.af-table--wide { min-width: 560px; }
.af-table--venta th:nth-child(2), .af-table--venta td:nth-child(2) { text-align: left; }
@media (max-width: 480px) { .af-table:not(.af-table--wide) th, .af-table:not(.af-table--wide) td { padding: 11px 12px; white-space: normal; } }
.af-table th, .af-table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid var(--dc-border);
    white-space: nowrap;
}
.af-table th:first-child, .af-table td:first-child { text-align: left; }
.af-table th {
    font-family: var(--dc-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--dc-muted-fg);
    background: var(--dc-muted);
}
.af-table td { color: var(--dc-fg); font-variant-numeric: tabular-nums; }
.af-table tbody tr:last-child td { border-bottom: 0; }
.af-row-bonus td { background: #f4f6fd; }
.af-row-bonus td:first-child::after {
    content: "bonus 15%";
    margin-left: 8px;
    font-family: var(--dc-mono);
    font-size: 10.5px;
    color: var(--dc-primary);
    border: 1px solid #c9cfe4;
    padding: 1px 5px;
    border-radius: 2px;
}
.af-row-total td { font-weight: 600; }

/* Reglas */
.af-rules {
    margin: 1.25rem 0 0;
    border: 1px solid var(--dc-border);
    background: var(--dc-card);
}
.af-rules > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--dc-border);
}
.af-rules > div:last-child { border-bottom: 0; }
@media (min-width: 720px) {
    .af-rules > div { grid-template-columns: 220px 1fr; gap: 24px; padding: 16px 22px; }
}
.af-rules dt { font-weight: 600; color: var(--dc-fg); font-size: 15px; }
.af-rules dd { margin: 0; font-size: 15px; line-height: 1.6; color: var(--dc-body); }

/* Pasos */
.af-steps {
    list-style: none;
    counter-reset: af;
    margin: 1.25rem 0 0;
    padding: 0;
}
.af-steps li {
    counter-increment: af;
    position: relative;
    padding: 14px 0 14px 52px;
    border-bottom: 1px solid var(--dc-border);
    line-height: 1.6;
    color: var(--dc-body);
}
.af-steps li::before {
    content: counter(af, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 14px;
    font-family: var(--dc-mono);
    font-size: 13px;
    color: var(--dc-primary);
}
.af-steps strong { color: var(--dc-fg); }

/* FAQ */
.af-faq { border-top: 1px solid var(--dc-border); margin-top: 1.25rem; }
.af-faq details { border-bottom: 1px solid var(--dc-border); }
.af-faq summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 32px 16px 0;
    font-weight: 600;
    color: var(--dc-fg);
    position: relative;
}
.af-faq summary::-webkit-details-marker { display: none; }
.af-faq summary::after {
    content: "+";
    position: absolute;
    right: 4px;
    top: 13px;
    font-family: var(--dc-mono);
    font-size: 18px;
    color: var(--dc-primary);
}
.af-faq details[open] summary::after { content: "–"; }
.af-faq details p { padding: 0 0 16px; margin: 0; max-width: 75ch; }

/* CTA final */
.af-cta {
    margin-top: clamp(1rem, 3vw, 2rem);
    background: var(--dc-primary);
    padding: clamp(2rem, 5vw, 3.25rem) !important;
    color: #fff;
}
.af-cta h2 {
    color: #fff !important;
    font-weight: 300;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    letter-spacing: -.03em;
    margin-bottom: 1rem;
}
.af-cta p { color: rgba(255, 255, 255, .85) !important; max-width: 62ch; }
.af-cta a:not(.af-btn) { color: #fff; }
.af-btn--light { background: #fff; border-color: #fff; color: var(--dc-primary) !important; }
.af-btn--light:hover { background: #eef2fa; }
.af-btn--ghost { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff !important; }
.af-btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.af-cta-small { font-size: 13px !important; margin: 1.25rem 0 0 !important; color: rgba(255, 255, 255, .65) !important; }

/* Mobile */
.af-mobile-only { display: none; }
@media (max-width: 640px) {
    .af-hero h1 { max-width: none; }
    .af-actions .af-btn { flex: 1 1 100%; }
    .af-cell { padding: 18px 16px 16px; }
    .af-rules > div { padding: 14px 16px; }
    .af-steps li { padding-left: 40px; }
    .af-cta { margin-left: -16px; margin-right: -16px; padding: 2rem 16px !important; }

    /* Tablas anchas: cada fila pasa a ser una tarjeta */
    .af-table-wrap--stack { overflow: visible; border: 0; background: transparent; }
    .af-table--stack { min-width: 0; display: block; }
    .af-table--stack thead { display: none; }
    .af-table--stack tbody { display: grid; gap: 10px; }
    .af-table--stack tr { display: block; border: 1px solid var(--dc-border); background: var(--dc-card); }
    .af-table--stack td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        white-space: normal;
        text-align: right;
    }
    .af-table--stack td:first-child {
        font-weight: 600;
        background: var(--dc-muted);
        border-bottom: 1px solid var(--dc-border);
        display: block;
        text-align: left;
    }
    .af-table--stack td[data-label]::before {
        content: attr(data-label);
        font-family: var(--dc-mono);
        font-size: 11.5px;
        letter-spacing: .03em;
        text-transform: uppercase;
        color: var(--dc-muted-fg);
        text-align: left;
    }
    .af-table--stack tbody tr:last-child td { border-bottom: 1px solid var(--dc-border); }
    .af-table--stack tr td:last-child { border-bottom: 0 !important; }
    .af-table--stack .af-mobile-only { display: inline; }
    .af-table--stack .af-desktop-only { display: none; }
    .af-row-bonus td:first-child { background: #f4f6fd; }
}

/* Encabezados centrados sobre las cajas, como en la portada y /planes/ */
.af-hero { text-align: center; }
.af-hero h1, .af-lead { margin-left: auto; margin-right: auto; }
.af-hero .af-actions { justify-content: center; }
.af-sec > .af-eyebrow, .af-sec > h2, .af-sec > h3, .af-sec > p { text-align: center; }
.af-sec > h2, .af-sec > h3, .af-sec > p { margin-left: auto; margin-right: auto; }
.af-sec > h2 { max-width: 26ch; }
.af-faq { max-width: 820px; margin-left: auto; margin-right: auto; }
.af-cta { text-align: center; }
.af-cta p { margin-left: auto; margin-right: auto; }
.af-cta .af-actions { justify-content: center; }
.af-sec > .af-eyebrow { max-width: none; }
.af-hero .af-lead { margin-left: auto; margin-right: auto; }
.af-cta .af-cta-small { margin: 1.25rem auto 0 !important; }
