﻿/* ════════════════════════════════════════════════════════════
   VitalSense ROI Calculator Styles
════════════════════════════════════════════════════════════ */

/* ── Page wrapper ──────────────────────────────────────────────────────────── */
.vs-calc-page {
    background: #f4f6f9;
    min-height: 100vh;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.vs-calc-hero {
    background: #0d1117;
    padding: 4rem 0 3rem;
    border-bottom: 1px solid rgba(45, 212, 160, 0.2);
}

.vs-calc-title {
    font-family: "Roboto", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0.5rem 0 1rem;
    line-height: 1.2;
}

.vs-calc-subtitle {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.05rem;
    color: #94a3b8;
    max-width: 640px;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.vs-calc-sources-note {
    font-size: 0.78rem;
    color: rgba(45, 212, 160, 0.7);
    font-family: "Roboto", sans-serif;
    letter-spacing: 0.01em;
}

/* ── KPI Bar ───────────────────────────────────────────────────────────────── */
.vs-calc-kpi-bar {
    background: #111827;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0;
}

.vs-calc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.vs-calc-kpi {
    padding: 1.1rem 1.5rem;
    border-right: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

    .vs-calc-kpi:last-child {
        border-right: none;
    }

.vs-calc-kpi-label {
    font-family: "Roboto", sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 0.3rem;
}

.vs-calc-kpi-value {
    font-family: "Roboto", sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

.vs-calc-kpi.risk .vs-calc-kpi-value {
    color: #f87171;
}

.vs-calc-kpi.invest .vs-calc-kpi-value {
    color: #60a5fa;
}

.vs-calc-kpi.savings .vs-calc-kpi-value {
    color: #2dd4a0;
}

.vs-calc-kpi.payback .vs-calc-kpi-value {
    color: #a78bfa;
}

.vs-calc-kpi.roi .vs-calc-kpi-value {
    color: #fbbf24;
}

/* ── Body ──────────────────────────────────────────────────────────────────── */
.vs-calc-body {
    padding: 2.5rem 0 5rem;
}

/* ── Main grid: left + right columns ──────────────────────────────────────── */
.vs-calc-main-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ── Left column ───────────────────────────────────────────────────────────── */
.vs-calc-left {
    position: sticky;
    top: 72px;
}

.vs-calc-inputs-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

    .vs-calc-inputs-card::-webkit-scrollbar {
        width: 4px;
    }

    .vs-calc-inputs-card::-webkit-scrollbar-thumb {
        background: #e5e7eb;
        border-radius: 2px;
    }

/* ── Right column ──────────────────────────────────────────────────────────── */
.vs-calc-right {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Two-column row inside right column */
.vs-calc-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

/* ── Results block ─────────────────────────────────────────────────────────── */
.vs-calc-results-block {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    height: 100%;
}

/* ── Section title ─────────────────────────────────────────────────────────── */
.vs-calc-section-title {
    font-family: "Roboto", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.vs-calc-section-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

    .vs-calc-section-badge.risk {
        background: #fee2e2;
        color: #b91c1c;
    }

    .vs-calc-section-badge.invest {
        background: #e0f2fe;
        color: #0369a1;
    }

    .vs-calc-section-badge.savings {
        background: rgba(45,212,160,0.12);
        color: #1a6b50;
    }

    .vs-calc-section-badge.quality {
        background: #f3e8ff;
        color: #7e22ce;
    }

/* ── Metric layouts ────────────────────────────────────────────────────────── */
.vs-calc-metrics-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.vs-calc-metrics-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.vs-calc-metrics-1col {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0;
}

/* ── Metric card ───────────────────────────────────────────────────────────── */
.vs-calc-metric-card {
    border-radius: 10px;
    padding: 0.9rem 0.85rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

    .vs-calc-metric-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }

    .vs-calc-metric-card.risk {
        background: #fff7f7;
        border: 1px solid #fecaca;
    }

        .vs-calc-metric-card.risk.high {
            background: #fff1f1;
            border: 1px solid #f87171;
        }

    .vs-calc-metric-card.invest {
        background: #f0f9ff;
        border: 1px solid #bae6fd;
    }

    .vs-calc-metric-card.savings {
        background: #f0fdf7;
        border: 1px solid #bbf7d0;
    }

.vs-calc-metric-icon {
    margin-bottom: 0.4rem;
}

    .vs-calc-metric-icon svg {
        width: 16px;
        height: 16px;
        stroke: #9ca3af;
    }

.vs-calc-metric-card.risk .vs-calc-metric-icon svg {
    stroke: #ef4444;
}

.vs-calc-metric-card.invest .vs-calc-metric-icon svg {
    stroke: #0ea5e9;
}

.vs-calc-metric-card.savings .vs-calc-metric-icon svg {
    stroke: #2dd4a0;
}

.vs-calc-metric-label {
    font-family: "Roboto", sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.vs-calc-metric-value {
    font-family: "Roboto", sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

    .vs-calc-metric-value.green {
        color: #1a6b50;
    }

.vs-calc-metric-card.risk .vs-calc-metric-value {
    color: #b91c1c;
}

.vs-calc-metric-card.risk.high .vs-calc-metric-value {
    color: #991b1b;
}

.vs-calc-metric-note {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 0.68rem;
    color: #9ca3af;
    line-height: 1.3;
}

@keyframes flashUpdate {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

.vs-calc-metric-value.updated,
.vs-calc-kpi-value.updated,
.vs-calc-cta-stat-val.updated {
    animation: flashUpdate 0.3s ease;
}

/* ── Total bar ─────────────────────────────────────────────────────────────── */
.vs-calc-total-bar {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

    .vs-calc-total-bar.risk {
        background: #fee2e2;
    }

    .vs-calc-total-bar.savings {
        background: rgba(45,212,160,0.1);
        border: 1px solid rgba(45,212,160,0.3);
    }

.vs-calc-total-label {
    font-family: "Roboto", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.vs-calc-total-value {
    font-family: "Roboto", sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    white-space: nowrap;
}

.vs-calc-total-bar.risk .vs-calc-total-value {
    color: #b91c1c;
}

.vs-calc-total-bar.savings .vs-calc-total-value {
    color: #1a6b50;
}

/* ── Reputational grid ─────────────────────────────────────────────────────── */
.vs-calc-rep-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.vs-calc-rep-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #7e22ce;
}

    .vs-calc-rep-item svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
        stroke: #7e22ce;
        margin-top: 2px;
    }

    .vs-calc-rep-item strong {
        display: block;
        font-family: "Roboto", sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        color: #111827;
        margin-bottom: 0.15rem;
    }

    .vs-calc-rep-item span {
        font-family: "Source Serif 4", Georgia, serif;
        font-size: 0.75rem;
        color: #6b7280;
        line-height: 1.45;
    }

/* ── CTA block ─────────────────────────────────────────────────────────────── */
.vs-calc-cta-block {
    background: #0d1117;
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    height: 100%;
    display: flex;
    align-items: stretch;
}

.vs-calc-cta-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    width: 100%;
    gap: 0.75rem;
}

.vs-calc-cta-icon svg {
    width: 44px;
    height: 44px;
    stroke: #2dd4a0;
}

.vs-calc-cta-inner h3 {
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.vs-calc-cta-inner > p {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

.vs-calc-cta-numbers {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}

.vs-calc-cta-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    flex: 1;
}

.vs-calc-cta-stat-val {
    font-family: "Roboto", sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #2dd4a0;
}

.vs-calc-cta-stat-label {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 0.68rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.vs-calc-cta-note {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 0.72rem;
    color: #4b5563;
    margin: 0;
}

/* ── Input fields ──────────────────────────────────────────────────────────── */
.vs-calc-field {
    margin-bottom: 1.4rem;
}

    .vs-calc-field label {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        font-family: "Roboto", sans-serif;
        font-size: 0.82rem;
        font-weight: 600;
        color: #374151;
        margin-bottom: 0.5rem;
    }

.vs-calc-label-val {
    font-weight: 700;
    color: #2dd4a0;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: right;
}

.vs-calc-field .form-select {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    padding: 0.5rem 0.85rem;
}

    .vs-calc-field .form-select:focus {
        border-color: #2dd4a0;
        box-shadow: 0 0 0 3px rgba(45,212,160,0.15);
    }

/* ── Sliders ───────────────────────────────────────────────────────────────── */
.vs-calc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
    margin: 0.2rem 0;
}

    .vs-calc-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #2dd4a0;
        border: 2px solid #fff;
        box-shadow: 0 1px 6px rgba(45,212,160,0.5);
        cursor: pointer;
        transition: transform 0.15s;
    }

        .vs-calc-slider::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }

    .vs-calc-slider::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #2dd4a0;
        border: 2px solid #fff;
        cursor: pointer;
    }

.vs-calc-slider-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #9ca3af;
    margin-top: 0.2rem;
    font-family: "Roboto", sans-serif;
}

.vs-calc-field-note {
    font-size: 0.72rem;
    color: #9ca3af;
    font-family: "Source Serif 4", Georgia, serif;
    font-style: italic;
    margin: 0.35rem 0 0;
    line-height: 1.4;
}

/* ── Assumptions ───────────────────────────────────────────────────────────── */
.vs-calc-assumptions-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-family: "Roboto", sans-serif;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: color 0.15s;
    user-select: none;
}

    .vs-calc-assumptions-toggle svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .vs-calc-assumptions-toggle:hover,
    .vs-calc-assumptions-toggle.open {
        color: #2dd4a0;
    }

.vs-calc-assumptions-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

    .vs-calc-assumptions-panel.open {
        max-height: 700px;
        margin-top: 0.85rem;
    }

.vs-calc-assumptions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    font-family: "Roboto", sans-serif;
}

    .vs-calc-assumptions-table th {
        background: #f9fafb;
        color: #374151;
        font-weight: 600;
        padding: 0.45rem 0.65rem;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
    }

    .vs-calc-assumptions-table td {
        padding: 0.4rem 0.65rem;
        color: #6b7280;
        border-bottom: 1px solid #f3f4f6;
        vertical-align: top;
    }

        .vs-calc-assumptions-table td:nth-child(2) {
            font-weight: 600;
            color: #374151;
            white-space: nowrap;
        }

    .vs-calc-assumptions-table a {
        color: #2dd4a0;
        text-decoration: none;
        font-weight: 500;
    }

        .vs-calc-assumptions-table a:hover {
            text-decoration: underline;
            color: #1a7a5e;
        }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
    .vs-calc-main-grid {
        grid-template-columns: 300px 1fr;
    }

    .vs-calc-metrics-4col {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 991px) {
    .vs-calc-main-grid {
        grid-template-columns: 1fr;
    }

    .vs-calc-left {
        position: static;
    }

    .vs-calc-inputs-card {
        max-height: none;
        overflow-y: visible;
    }

    .vs-calc-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .vs-calc-kpi:nth-child(4),
    .vs-calc-kpi:nth-child(5) {
        border-top: 1px solid rgba(255,255,255,0.06);
    }
}

@media (max-width: 767px) {
    .vs-calc-row-2col {
        grid-template-columns: 1fr;
    }

    .vs-calc-metrics-4col {
        grid-template-columns: 1fr 1fr;
    }

    .vs-calc-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .vs-calc-cta-numbers {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .vs-calc-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .vs-calc-metrics-2col,
    .vs-calc-metrics-4col {
        grid-template-columns: 1fr;
    }

    .vs-calc-total-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}
