/* ==========================================================================
   LA AGENDA DE CITAS
   Loaded after styles-redesign.css (tokens live there) and language-toggle.css.
   World: navy cloth cover with gold foil, cool ledger paper with blue rules,
   a red margin line, ballpoint ink and pencil. Flat, no leather skeuomorphism.
   ========================================================================== */

::selection {
    background: var(--primary);
    color: var(--cover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

/* On paper the gold ring is too faint: use navy there. */
.section a:focus-visible,
.section button:focus-visible,
.section input:focus-visible,
.section select:focus-visible {
    outline-color: var(--cover);
}

/* --- Type ----------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    letter-spacing: -0.015em;
}

.section-title {
    font-weight: 700;
    font-size: clamp(1.95rem, 1.3rem + 2.3vw, 3rem);
    letter-spacing: -0.025em;
    line-height: 1.08;
    text-wrap: balance;
    margin-bottom: 18px;
}

.lead {
    font-size: 1.12rem;
    line-height: 1.6;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
    border-radius: 6px;
    letter-spacing: 0.005em;
}

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
    background: #e0bd47;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.55);
}

.btn-secondary {
    border: 1.5px solid var(--cover);
    color: var(--cover);
}

.btn-secondary:hover {
    background: rgba(20, 35, 63, 0.06);
}

/* --- Header: the cover's spine ------------------------------------------- */
.header {
    position: fixed;
    background: var(--cover);
    padding: 12px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    transition: border-color 0.3s;
}

.header.scrolled {
    background: var(--cover);
    backdrop-filter: none;
    border-bottom-color: rgba(212, 175, 55, 0.45);
    padding: 12px 0;
}

.logo-mark {
    height: 40px;
    margin-right: 10px;
    border-radius: 4px;
}

.logo-word {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.01em;
    color: var(--primary);
}

.nav-link {
    color: var(--text-on-dark-sec);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--primary);
}

.btn-language,
.btn-language:hover {
    background: transparent;
    color: var(--text-on-dark);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: none;
    border-radius: 6px;
}

.btn-language:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: none;
}

.mobile-menu-btn {
    color: #fff;
}

@media (max-width: 1150px) {
    .nav-menu {
        background: var(--cover-deep);
        backdrop-filter: none;
        border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    }

    .nav-link {
        color: var(--text-on-dark);
        padding: 6px 0;
    }

    .mobile-menu-btn {
        color: #fff;
    }
}

/* --- Hero: the cover ------------------------------------------------------ */
.hero {
    padding-top: 150px;
    padding-bottom: 96px;
    background-color: var(--cover);
    background-image:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px);
    color: var(--text-on-dark);
}

/* Stamped foil frame, like the border pressed into a cloth cover. */
.hero::after {
    content: "";
    position: absolute;
    inset: 84px 18px 18px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    pointer-events: none;
}

.hero-container {
    position: relative;
    z-index: 1;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary);
    font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.2rem);
    line-height: 1.03;
    letter-spacing: -0.03em;
    margin-bottom: 26px;
}

.hero .hero-subtitle,
.hero .lead {
    color: var(--text-on-dark-sec);
}

.hero .btn-primary {
    background: var(--primary);
    color: var(--cover);
}

.hero .btn-secondary {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
}

.hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: #fff;
}

.hero .deck-link a {
    color: var(--primary);
}

.hero .deck-link a:hover {
    color: #fff;
}

.hero-ctas {
    gap: 16px;
}

/* --- Hero visual: agenda page + WhatsApp chat ----------------------------- */
.hero-visual {
    position: relative;
    min-height: 700px;
}

.agenda-page {
    position: absolute;
    top: 0;
    right: 0;
    width: 86%;
    padding: 22px 22px 18px 74px;
    background-color: #fff;
    background-image: linear-gradient(var(--rule) 1px, transparent 1px);
    background-size: 100% 52px;
    background-position: 0 70px;
    color: var(--text-main);
    border-radius: 6px;
    box-shadow:
        0 44px 70px -30px rgba(0, 0, 0, 0.7),
        0 10px 24px -10px rgba(0, 0, 0, 0.4);
    transform: rotate(2.4deg);
}

/* The red margin line every ledger page has. */
.agenda-page::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 66px;
    width: 2px;
    background: var(--margin-red);
    opacity: 0.55;
}

.agenda-head {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: -0.02em;
    color: var(--cover);
    height: 48px;
    line-height: 48px;
    margin: 0;
}

.agenda-rows {
    list-style: none;
}

.agenda-rows li {
    position: relative;
    height: 52px;
    display: flex;
    align-items: center;
}

.agenda-rows time {
    position: absolute;
    left: -52px;
    width: 44px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--pencil);
    font-variant-numeric: tabular-nums;
    text-align: right;
    line-height: 1.1;
}

.agenda-entry {
    font-family: var(--font-hand);
    font-weight: 500;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--ink);
    white-space: nowrap;
}

/* Today's newest entry is the darkest ink on the page, and it writes itself
   right after the chat's last bubble lands. */
.agenda-rows li.is-new .agenda-entry {
    position: relative;
    font-weight: 600;
    color: var(--cover);
    padding: 0 4px;
    background: linear-gradient(transparent 58%, rgba(212, 175, 55, 0.55) 58%);
    clip-path: inset(0 100% 0 0);
    animation: agenda-write 1.2s cubic-bezier(0.16, 1, 0.3, 1) 4.2s forwards;
}

@keyframes agenda-write {
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* The chat sits over the page, bottom left. */
.hero-visual .whatsapp-mock {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60%;
    height: 468px;
    aspect-ratio: auto;
    max-height: none;
    z-index: 2;
    border: 0;
    border-radius: 14px;
    box-shadow:
        0 40px 60px -24px rgba(0, 0, 0, 0.75),
        0 8px 18px -8px rgba(0, 0, 0, 0.45);
    transform: rotate(-1.4deg);
}

.hero-visual .whatsapp-mock-body {
    overflow: hidden;
    padding: 14px 12px;
    gap: 8px;
}

.hero-visual .whatsapp-mock-bubble {
    font-size: 0.8rem;
    padding: 7px 11px;
}

/* --- Stats bar: the ledger's column heads --------------------------------- */
.stats-bar {
    background: var(--bg-sec);
    border: 0;
    border-bottom: 1px solid var(--rule-strong);
    padding: 44px 0;
}

.stats-grid {
    gap: 0;
}

.stat-item {
    padding: 0 20px;
}

.stat-item + .stat-item {
    border-left: 1px solid var(--rule-strong);
}

.stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--cover);
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-sec);
}

/* --- Sections: a ribbon marker hangs from every page ---------------------- */
.section {
    position: relative;
    padding: 96px 0;
}

.section::before {
    content: "";
    position: absolute;
    top: 0;
    left: max(20px, calc((100% - 1200px) / 2 + 20px));
    width: 20px;
    height: 44px;
    background: var(--primary);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

.section.contact-section::before,
.section.timeline-section::before {
    background: var(--cover);
}

/* --- Soluciones: entries, not cards --------------------------------------- */
.solucion-card {
    border-radius: 0;
    border-top: 3px solid var(--cover);
    background: transparent;
}

.solucion-card:hover {
    transform: none;
}

.solucion-card img {
    border-radius: 0;
}

.solucion-content {
    padding: 22px 0 8px;
}

.solucion-card.grande .solucion-content {
    padding: 40px 0 40px 44px;
}

.solucion-content h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mini-chat {
    border-radius: 0;
}

/* --- Cómo funciona: a red margin, steps stamped like hours ---------------- */
.timeline::before {
    left: 21px;
    width: 2px;
    background: var(--margin-red);
    opacity: 0.55;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--cover);
    border: 0;
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.step-content h3 {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
}

/* --- Calculator: the ledger total ----------------------------------------- */
.calculator-card {
    border: 1px solid var(--rule-strong);
    border-top: 6px solid var(--cover);
    border-radius: 0;
    box-shadow: var(--shadow-md);
}

.calculator-input input[type="range"] {
    accent-color: var(--cover);
}

.calculator-hours-value {
    color: var(--cover);
    font-weight: 700;
}

.calc-result {
    background: transparent;
    border-radius: 0;
    border-bottom: 5px double var(--cover);
    padding: 20px 12px 16px;
}

.calc-result-value {
    color: var(--cover);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --- Plans: pages of the book --------------------------------------------- */
.pricing-plan {
    background: #fff;
    border: 1px solid var(--rule-strong);
    border-top: 6px solid var(--cover);
    border-radius: 0;
    padding: 36px 34px 34px;
}

.pricing-plan.recommended {
    background: #fff;
    border: 2px solid var(--cover);
    border-top: 6px solid var(--primary);
    box-shadow: 0 30px 50px -28px rgba(0, 0, 0, 0.5);
}

/* The recommended plan gets the red ribbon bookmark. */
.popular-tag {
    top: -6px;
    left: auto;
    right: 26px;
    transform: none;
    width: 86px;
    padding: 12px 10px 24px;
    border-radius: 0;
    background: var(--margin-red);
    color: #fff;
    font-size: 0.74rem;
    line-height: 1.15;
    text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
}

.plan-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.plan-price b {
    color: var(--cover);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.plan-setup {
    border-bottom: 2px solid var(--cover);
}

.plan-features li {
    padding: 9px 0 9px 28px;
    margin: 0;
    border-bottom: 1px solid var(--rule);
}

.plan-features li::before {
    content: "";
    left: 4px;
    top: 13px;
    width: 6px;
    height: 12px;
    border: solid var(--ink);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(40deg);
}

.plan-pill {
    border-radius: 4px;
    border-color: var(--rule-strong);
}

.plan-pill.gold {
    background: var(--primary-tint);
    border-color: var(--primary);
}

/* --- What you pay: ruled columns ------------------------------------------ */
.transp-section {
    background: var(--bg-sec);
}

.transp-col:not(:first-child) {
    border-left-color: var(--rule-strong);
}

.transp-col h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.transp-extras > div {
    border-bottom-color: var(--rule-strong);
}

.transp-check {
    color: var(--ink);
}

/* --- Deck band: a gold-foil tab between the pages ------------------------- */
.deck-band h2 {
    font-weight: 700;
    letter-spacing: -0.03em;
}

.deck-band-btn {
    background: var(--cover);
    border-radius: 6px;
}

.deck-band-preview img {
    border-radius: 6px;
}

/* --- FAQ: index lines ----------------------------------------------------- */
.accordion-item {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--rule-strong);
    border-radius: 0;
    margin-bottom: 0;
}

.accordion-header {
    padding: 24px 4px;
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.accordion-header::after {
    color: var(--cover);
    font-size: 1.5rem;
}

.accordion-body {
    padding: 0 4px;
}

/* --- Contact: a fresh entry ----------------------------------------------- */
.contact-card {
    background: transparent;
    border: 0;
    border-top: 3px solid var(--cover);
    border-radius: 0;
    padding: 20px 0 8px;
    margin-bottom: 24px;
}

.contact-card h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.contact-form {
    background: #fff;
    border: 1px solid var(--rule-strong);
    border-top: 6px solid var(--cover);
    border-radius: 0;
    box-shadow: var(--shadow-md);
}

.contact-form h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.form-group label {
    font-weight: 600;
    color: var(--cover);
}

.form-group input,
.form-group select {
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--rule-strong);
    border-radius: 0;
    padding: 12px 2px;
}

.form-group input:focus,
.form-group select:focus {
    border-bottom-color: var(--cover);
    box-shadow: 0 2px 0 0 var(--primary);
    outline: none;
}

.form-group input[aria-invalid="true"] {
    border-bottom-color: var(--margin-red);
}

/* --- Footer: the back cover ------------------------------------------------ */
.footer {
    background-color: var(--cover);
    background-image:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px);
    margin-top: 0;
    border-top: 0;
    padding-top: 72px;
}

.footer .logo-word {
    color: var(--primary);
}

.footer-col h4 {
    color: var(--primary);
    font-weight: 700;
}

.footer-bottom {
    border-top-color: rgba(212, 175, 55, 0.25);
}

/* --- Modal and sticky bar -------------------------------------------------- */
.modal-content {
    border-radius: 0;
    border-top: 6px solid var(--cover);
}

.modal-content h2 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mobile-sticky-bar {
    background: var(--cover);
    border-top: 1px solid rgba(212, 175, 55, 0.4);
}

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 22px;
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }

    .hero-visual .whatsapp-mock {
        position: relative;
        order: 1;
        width: 100%;
        transform: none;
        aspect-ratio: auto;
        height: auto;
        max-height: none;
    }

    .agenda-page {
        position: relative;
        order: 2;
        width: 100%;
        transform: none;
    }

    .solucion-card.grande .solucion-content {
        padding: 24px 0 8px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-top: 118px;
        padding-bottom: 64px;
    }

    .hero::after {
        inset: 74px 10px 10px;
    }

    .section {
        padding: 72px 0;
    }

    .section::before {
        left: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .stat-item {
        padding: 18px 0;
    }

    .stat-item + .stat-item {
        border-left: 0;
        border-top: 1px solid var(--rule-strong);
    }

    .transp-col:not(:first-child) {
        border-top-color: var(--rule-strong);
    }

    .footer {
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .agenda-rows li.is-new .agenda-entry {
        animation: none;
        clip-path: none;
    }
}

/* --- Real case: the ledger entry corrected from 47 to 31 ------------------ */
.real-case-section {
    background: var(--bg-sec);
}

.real-case-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 72px;
    align-items: center;
}

.real-case-copy .section-title {
    margin-bottom: 18px;
}

.real-case-steps {
    list-style: none;
    counter-reset: caseStep;
    margin: 30px 0 22px;
}

.real-case-steps li {
    counter-increment: caseStep;
    position: relative;
    padding: 16px 0 16px 60px;
    border-bottom: 1px solid var(--rule-strong);
}

.real-case-steps li::before {
    content: counter(caseStep);
    position: absolute;
    left: 0;
    top: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--cover);
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.real-case-steps b {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-main);
}

.real-case-steps span {
    color: var(--text-sec);
}

.real-case-note {
    font-size: 0.9rem;
    color: var(--text-sec);
}

.real-case-ledger {
    position: relative;
    margin: 0;
    padding: 40px 36px 34px 92px;
    background-color: #fff;
    background-image: linear-gradient(var(--rule) 1px, transparent 1px);
    background-size: 100% 56px;
    background-position: 0 24px;
    border: 1px solid var(--rule-strong);
    border-top: 6px solid var(--cover);
    border-radius: 0;
    box-shadow: var(--shadow-md);
}

.real-case-ledger::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 70px;
    width: 2px;
    background: var(--margin-red);
    opacity: 0.55;
}

.real-case-figures {
    display: flex;
    align-items: baseline;
    gap: 34px;
}

/* The old figure is struck through in red ballpoint... */
.real-case-old {
    position: relative;
    font-family: var(--font-hand);
    font-weight: 500;
    font-size: clamp(3.4rem, 2.4rem + 4vw, 5.4rem);
    line-height: 1;
    color: var(--pencil);
}

.real-case-old::after {
    content: "";
    position: absolute;
    left: -8%;
    right: -8%;
    top: 52%;
    height: 5px;
    background: var(--margin-red);
    border-radius: 3px;
    transform: rotate(-8deg) scaleX(0);
    transform-origin: left center;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

/* ...and the corrected one is the darkest ink on the page. */
.real-case-new {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(5.4rem, 3.4rem + 8vw, 9rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    color: var(--cover);
    background: linear-gradient(transparent 62%, rgba(212, 175, 55, 0.55) 62%);
    padding: 0 8px;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.1s;
}

.real-case-ledger.is-visible .real-case-old::after {
    transform: rotate(-8deg) scaleX(1);
}

.real-case-ledger.is-visible .real-case-new {
    clip-path: inset(0 0 0 0);
}

.real-case-ledger figcaption {
    margin-top: 18px;
    font-weight: 600;
    color: var(--cover);
}

@media (max-width: 992px) {
    .real-case-grid {
        grid-template-columns: 1fr;
        gap: 44px;
    }
}

@media (max-width: 480px) {
    .real-case-ledger {
        padding: 32px 20px 28px 64px;
    }

    .real-case-ledger::before {
        left: 46px;
    }

    .real-case-figures {
        gap: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .real-case-old::after,
    .real-case-new {
        transition: none;
        transform: rotate(-8deg) scaleX(1);
        clip-path: none;
    }

    .real-case-new {
        transform: none;
    }
}

/* --- Clients: the book's contact entries ---------------------------------- */
.clients-head {
    max-width: 640px;
    margin-bottom: 44px;
}

.clients-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.client-entry {
    border-top: 3px solid var(--cover);
    padding-top: 24px;
}

.client-logo {
    height: 120px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 22px;
}

.client-entry h3 {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.client-product {
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 8px;
}

.client-entry p {
    color: var(--text-sec);
}

.client-entry .client-product {
    color: var(--primary-text);
}

@media (max-width: 992px) {
    .clients-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* --- Status dot stays still; timestamps stay readable ---------------------- */
.whatsapp-mock-status-dot {
    animation: none;
}

.whatsapp-mock-time {
    color: rgba(16, 26, 47, 0.68);
}

.mini-chat-bubble .whatsapp-mock-time {
    color: rgba(16, 26, 47, 0.68);
}
