:root {
    --roi-navy: #0a2f57;
    --roi-teal: #1aa0c7;
    --roi-bg: #f3f7fb;
    --roi-card: #ffffff;
    --roi-border: #d7e3ef;
    --roi-text: #1f2d3d;
    --roi-muted: #5a6a7a;
    --roi-success: #0f6b43;
    --roi-danger: #9a2f2f;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: linear-gradient(165deg, #071f3d 0%, #0a2f57 42%, #0d4a6f 100%);
    color: var(--roi-text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    margin: 0;
    min-height: 100vh;
}

.roi-page {
    display: grid;
    gap: 20px;
    margin: 0 auto;
    max-width: 920px;
    padding: 28px 16px 40px;
}

.roi-nav {
    align-items: center;
    display: flex;
    justify-content: flex-start;
}

.roi-back {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.92rem;
    font-weight: 600;
    gap: 4px;
    padding: 8px 14px 8px 10px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.roi-back:hover,
.roi-back:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.38);
    color: #fff;
    outline: none;
}

.roi-back:focus-visible {
    box-shadow: 0 0 0 3px rgba(26, 160, 199, 0.45);
}

.roi-hero {
    color: #fff;
    text-align: center;
}

.roi-hero h1 {
    font-size: clamp(1.55rem, 3.2vw, 2.15rem);
    line-height: 1.2;
    margin: 0 0 10px;
}

.roi-hero p {
    color: rgba(255, 255, 255, 0.88);
    margin: 0 auto;
    max-width: 620px;
}

.roi-guide {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(7, 36, 76, 0.14);
    color: var(--roi-text);
    overflow: hidden;
}

.roi-guide__summary {
    align-items: center;
    color: var(--roi-navy);
    cursor: pointer;
    display: flex;
    font-size: 1rem;
    font-weight: 700;
    gap: 10px;
    list-style: none;
    padding: 16px 20px;
    user-select: none;
}

.roi-guide__summary::-webkit-details-marker {
    display: none;
}

.roi-guide__summary::after {
    color: var(--roi-teal);
    content: "▾";
    font-size: 1.1rem;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.roi-guide:not([open]) .roi-guide__summary::after {
    transform: rotate(-90deg);
}

.roi-guide__summary:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 3px rgba(26, 160, 199, 0.45);
}

.roi-guide__summary-icon {
    align-items: center;
    background: linear-gradient(135deg, var(--roi-teal), #7ec8e3);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-size: 0.95rem;
    font-weight: 800;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.roi-guide__body {
    border-top: 1px solid var(--roi-border);
    padding: 0 20px 18px;
}

.roi-guide__lead {
    color: var(--roi-text);
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 16px 0 14px;
}

.roi-guide__steps {
    color: var(--roi-text);
    display: grid;
    gap: 12px;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 0 14px;
    padding-left: 1.25rem;
}

.roi-guide__steps strong {
    color: var(--roi-navy);
}

.roi-guide__note {
    background: var(--roi-bg);
    border-radius: 12px;
    color: var(--roi-muted);
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0;
    padding: 12px 14px;
}

.roi-card {
    background: var(--roi-card);
    border: 1px solid var(--roi-border);
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(7, 36, 76, 0.12);
    padding: 22px 20px;
}

.roi-card h2 {
    color: var(--roi-navy);
    font-size: 1.1rem;
    margin: 0 0 16px;
}

.roi-slider {
    margin-bottom: 20px;
}

.roi-slider:last-child {
    margin-bottom: 0;
}

.roi-slider__head {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.roi-slider__head label {
    color: var(--roi-navy);
    font-size: 0.92rem;
    font-weight: 600;
}

.roi-slider__head output {
    color: var(--roi-teal);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.roi-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    display: block;
    width: 100%;
}

.roi-slider input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, var(--roi-teal), #7ec8e3);
    border-radius: 999px;
    height: 8px;
}

.roi-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
    border: 3px solid var(--roi-navy);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(7, 36, 76, 0.2);
    height: 22px;
    margin-top: -7px;
    width: 22px;
}

.roi-slider input[type="range"]::-moz-range-track {
    background: linear-gradient(90deg, var(--roi-teal), #7ec8e3);
    border: 0;
    border-radius: 999px;
    height: 8px;
}

.roi-slider input[type="range"]::-moz-range-thumb {
    background: #fff;
    border: 3px solid var(--roi-navy);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(7, 36, 76, 0.2);
    height: 22px;
    width: 22px;
}

.roi-slider input[type="range"]:focus-visible {
    outline: 2px solid var(--roi-teal);
    outline-offset: 4px;
}

.roi-slider small {
    color: var(--roi-muted);
    display: block;
    font-size: 0.82rem;
    margin-top: 6px;
}

.roi-coste-mode {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.roi-segmented {
    background: var(--roi-bg);
    border: 1px solid var(--roi-border);
    border-radius: 10px;
    display: inline-flex;
    padding: 3px;
}

.roi-segmented input {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.roi-segmented label {
    border-radius: 8px;
    color: var(--roi-muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 7px 10px;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
}

.roi-segmented input:checked + label {
    background: var(--roi-navy);
    color: #fff;
}

.roi-segmented input:focus-visible + label {
    outline: 2px solid var(--roi-teal);
    outline-offset: 2px;
}

.roi-help-wrap {
    position: relative;
}

.roi-help-btn {
    align-items: center;
    background: transparent;
    border: 1px solid var(--roi-border);
    border-radius: 50%;
    color: var(--roi-muted);
    cursor: help;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    padding: 0;
    width: 28px;
}

.roi-help-btn:hover,
.roi-help-btn:focus-visible {
    border-color: var(--roi-teal);
    color: var(--roi-teal);
    outline: none;
}

.roi-help-tip {
    background: var(--roi-navy);
    border-radius: 8px;
    color: #fff;
    display: none;
    font-size: 0.78rem;
    left: 50%;
    line-height: 1.4;
    max-width: 240px;
    padding: 8px 10px;
    position: absolute;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    width: max-content;
    z-index: 5;
}

.roi-help-wrap:hover .roi-help-tip,
.roi-help-wrap:focus-within .roi-help-tip {
    display: block;
}

.roi-coste-effective {
    color: var(--roi-teal);
    font-weight: 600;
}

.roi-formula__note {
    color: var(--roi-muted);
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0 0 8px;
}

.roi-results-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.roi-results-title {
    color: #fff;
    font-size: 1.05rem;
    margin: 0;
    text-align: center;
}

.roi-methodology-trigger {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    gap: 6px;
    line-height: 1.2;
    padding: 6px 12px;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    z-index: 3;
}

.roi-methodology-trigger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.roi-methodology-trigger:focus-visible {
    outline: 2px solid var(--roi-teal);
    outline-offset: 3px;
}

.roi-methodology-trigger__icon {
    flex-shrink: 0;
    opacity: 0.9;
}

.roi-results {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roi-result-card {
    background: var(--roi-card);
    border: 1px solid var(--roi-border);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(7, 36, 76, 0.1);
    padding: 16px;
    text-align: center;
}

.roi-result-card h3 {
    color: var(--roi-muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.roi-result-card__value {
    color: var(--roi-navy);
    font-size: clamp(1.2rem, 2.8vw, 1.55rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.roi-result-card__value.is-positive {
    color: var(--roi-success);
}

.roi-result-card__value.is-negative {
    color: var(--roi-danger);
}

.roi-email-intro {
    color: var(--roi-muted);
    font-size: 0.92rem;
    margin: -6px 0 16px;
}

.roi-field {
    margin-bottom: 14px;
}

.roi-field label {
    color: var(--roi-navy);
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.roi-field input[type="text"],
.roi-field input[type="email"] {
    border: 1px solid var(--roi-border);
    border-radius: 10px;
    font-size: 1rem;
    padding: 11px 12px;
    width: 100%;
}

.roi-field input:focus {
    border-color: var(--roi-teal);
    box-shadow: 0 0 0 3px rgba(26, 160, 199, 0.18);
    outline: none;
}

.roi-btn {
    background: linear-gradient(135deg, var(--roi-navy), var(--roi-teal));
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 4px;
    padding: 13px 24px;
    width: 100%;
}

.roi-btn:hover:not(:disabled) {
    filter: brightness(1.05);
}

.roi-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.roi-btn--secondary {
    background: transparent;
    border: 2px solid var(--roi-navy);
    color: var(--roi-navy);
    margin-top: 0;
    width: 100%;
}

.roi-btn--secondary:hover:not(:disabled) {
    background: rgba(10, 47, 87, 0.06);
    filter: none;
}

body.roi-modal-open {
    overflow: hidden;
}

.roi-modal {
    display: none;
    inset: 0;
    position: fixed;
    z-index: 1000;
}

.roi-modal.is-open {
    display: block;
}

.roi-modal[hidden]:not(.is-open) {
    display: none !important;
}

.roi-modal__overlay {
    background: rgba(7, 31, 61, 0.62);
    cursor: pointer;
    inset: 0;
    position: absolute;
    z-index: 0;
}

.roi-modal__panel {
    background: var(--roi-card);
    border: 1px solid var(--roi-border);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(7, 36, 76, 0.28);
    left: 50%;
    max-height: min(88vh, 720px);
    max-width: 560px;
    overflow-y: auto;
    padding: 24px 22px 22px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    z-index: 1;
}

.roi-modal__close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--roi-muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.75rem;
    height: 36px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 12px;
    top: 10px;
    width: 36px;
}

.roi-modal__close:hover {
    background: rgba(10, 47, 87, 0.06);
    color: var(--roi-navy);
}

.roi-modal__close:focus-visible {
    outline: 2px solid var(--roi-teal);
    outline-offset: 2px;
}

.roi-modal__title {
    color: var(--roi-navy);
    font-size: 1.25rem;
    line-height: 1.25;
    margin: 0 32px 10px 0;
}

.roi-modal__intro {
    color: var(--roi-muted);
    font-size: 0.92rem;
    margin: 0 0 18px;
}

.roi-modal__section {
    margin-bottom: 18px;
}

.roi-modal__section-title {
    color: var(--roi-navy);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.roi-modal__formulas {
    background: var(--roi-bg);
    border: 1px solid var(--roi-border);
    border-radius: 14px;
    display: grid;
    gap: 14px;
    padding: 14px;
}

.roi-formula__label {
    color: var(--roi-navy);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px;
}

.roi-formula__example {
    color: var(--roi-text);
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0;
}

.roi-formula__example strong {
    color: var(--roi-teal);
    font-weight: 800;
}

.roi-formula__nums {
    color: var(--roi-muted);
}

.roi-modal__assumptions {
    color: var(--roi-text);
    font-size: 0.88rem;
    margin: 0;
    padding-left: 1.15rem;
}

.roi-modal__assumptions li {
    margin-bottom: 8px;
}

.roi-modal__assumptions li:last-child {
    margin-bottom: 0;
}

.roi-modal__closing {
    color: var(--roi-muted);
    font-size: 0.88rem;
    margin: 0 0 16px;
}

.roi-alert {
    border-radius: 10px;
    display: none;
    font-size: 0.92rem;
    margin-top: 14px;
    padding: 12px 14px;
}

.roi-alert.is-visible {
    display: block;
}

.roi-alert--error {
    background: #fdecec;
    border: 1px solid #f3c2c2;
    color: var(--roi-danger);
}

.roi-alert--success {
    background: #e8f8ef;
    border: 1px solid #b9e5cb;
    color: var(--roi-success);
}

.roi-footnote {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.84rem;
    margin: 0;
    text-align: center;
}

.roi-card--next {
    border-color: rgba(26, 160, 199, 0.35);
    box-shadow: 0 16px 36px rgba(7, 36, 76, 0.14);
}

.roi-card--next__eyebrow {
    color: var(--roi-teal);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.roi-card--next__title {
    color: var(--roi-navy);
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0 0 8px;
}

.roi-card--next__lead {
    color: var(--roi-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 16px;
}

.roi-card--next__alt {
    font-size: 0.85rem;
    margin: 12px 0 0;
    text-align: center;
}

.roi-card--next__alt a {
    color: var(--roi-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.roi-card--next__alt a:hover {
    color: var(--roi-navy);
}

.roi-btn--diagnostico {
    display: inline-flex;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    width: 100%;
}

.roi-post-success {
    margin-top: 12px;
}

.roi-modal__actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.roi-modal__actions .roi-btn--diagnostico,
.roi-modal__actions .roi-btn--secondary {
    margin-top: 0;
    width: 100%;
}

@media (max-width: 640px) {
    .roi-results {
        grid-template-columns: 1fr;
    }

    .roi-page {
        padding-inline: 14px;
    }

    .roi-modal__panel {
        border-radius: 16px;
        max-height: 92vh;
        padding: 20px 16px 18px;
        width: calc(100% - 20px);
    }

    .roi-results-head {
        flex-direction: column;
    }

    .roi-segmented {
        width: 100%;
    }

    .roi-segmented label {
        flex: 1 1 50%;
        text-align: center;
    }

    .roi-help-tip {
        left: auto;
        max-width: min(240px, 88vw);
        right: 0;
        transform: none;
    }
}

@media (min-width: 768px) {
    .roi-btn {
        width: auto;
    }

    .roi-btn--secondary {
        width: auto;
    }

    .roi-btn--diagnostico {
        min-width: 320px;
        width: auto;
    }
}
