/* =========================
   TCO Calculator (scoped)
   все тільки всередині .tcoCalc / .ccalc
========================= */

.tcoCalc,
.tcoCalc * {
    box-sizing: border-box;
}

.tcoCalc {
    --cc-card: #fff;
    --cc-text: #222;
    --cc-muted: #6b7280;
    --cc-brand: #283b69;
    --cc-brand2: #1f2f55;
    --cc-border: #e6e8ef;
    --cc-shadow: 0 10px 25px rgba(16, 24, 40, 0.08);
    --cc-radius: 16px;

    font-family: Arial, Helvetica, sans-serif;
    color: var(--cc-text);
}

/* Wrap */
.tcoCalc .ccalc__wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 0 40px;
}

/* Titlebar */
.tcoCalc .ccalc__titlebar {
    background: linear-gradient(180deg, var(--cc-brand), var(--cc-brand2));
    color: #fff;
    border-radius: var(--cc-radius);
    padding: 16px;
    box-shadow: var(--cc-shadow);
    margin-bottom: 14px;
}

.tcoCalc .ccalc__h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.tcoCalc .ccalc__p {
    margin: 6px 0 0;
    opacity: 0.92;
    font-size: 13px;
}

/* Grid */
.tcoCalc .ccalc__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 14px;
    align-items: start;
}

@media (max-width: 980px) {
    .tcoCalc .ccalc__grid {
        grid-template-columns: 1fr;
    }
}

/* Card */
.tcoCalc .ccalc__card {
    background: var(--cc-card);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    padding: 14px;
    min-width: 0;
}

/* Section title */
.tcoCalc .ccalc__sectionTitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--cc-border);
}

.tcoCalc .ccalc__h2 {
    font-size: 15px;
    margin: 0;
    font-weight: 800;
    color: var(--cc-brand2);
}

.tcoCalc .ccalc__badge {
    font-size: 12px;
    color: #fff;
    background: rgba(40, 59, 105, 0.9);
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* Autocalc checkbox (HTML class = evc-autocalc) */
.evc-topline {
    margin-top: 8px;
}

.evc-autocalc {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: #111827;
    font-size: 13px;
    user-select: none;
    white-space: nowrap;
}

.evc-autocalc input {
    width: 16px;
    height: 16px;
    accent-color: #283b69;
}

/* Fields */
.tcoCalc .ccalc__rows {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

@media (max-width: 680px) {
    .tcoCalc .ccalc__rows {
        grid-template-columns: 1fr;
    }
}

.tcoCalc .ccalc__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tcoCalc .ccalc__label {
    font-weight: 800;
    color: #111827;
    font-size: 13px;
}

.tcoCalc .ccalc__input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    padding: 0 12px;
    outline: none;
    background: #fff;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}

.tcoCalc .ccalc__input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.tcoCalc .ccalc__input:focus {
    border-color: rgba(40, 59, 105, 0.45);
    box-shadow: 0 0 0 4px rgba(40, 59, 105, 0.1);
    color: #111827;
}

.tcoCalc .ccalc__hint {
    font-size: 12px;
    color: var(--cc-muted);
    margin-top: 2px;
}

/* Currency hint */
.tco-currency-hint:empty {
    display: none;
}

/* Actions */
.tcoCalc .ccalc__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tcoCalc .ccalc__btn {
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--cc-border);
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    color: var(--cc-brand2);
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.tcoCalc .ccalc__btn--primary {
    border-color: rgba(40, 59, 105, 0.35);
    background: rgba(40, 59, 105, 0.08);
}

.tcoCalc .ccalc__toast {
    margin-top: 10px;
    font-size: 12px;
    color: var(--cc-muted);
    min-height: 16px;
}

/* Actions row layout (left + right groups) */
.tco-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tco-actions-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tco-actions-right {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

/* green buttons */
.ccalc__btn.tco-btn-green {
    background: #e8f7ec;
    border: 1px solid #9bd3af;
    color: #14532d;
    font-weight: 700;
}

.ccalc__btn.tco-btn-green:hover {
    background: #dcf3e4;
    border-color: #7bc49a;
}

@media (max-width: 768px) {
    .tco-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tco-actions-left,
    .tco-actions-right {
        justify-content: center;
    }

    .tco-actions-right {
        gap: 16px;
    }

    .tcoCalc .ccalc__btn {
        min-width: 0;
        width: 100%;
    }
}

/* Spacing utilities */
.tcoCalc .ccalc__mt10 {
    margin-top: 10px;
}

.tcoCalc .ccalc__mb10 {
    margin-bottom: 10px;
}

/* Big result box */
.tcoCalc .ccalc__bigNumber {
    background: linear-gradient(180deg,
            rgba(40, 59, 105, 0.08),
            rgba(40, 59, 105, 0.03));
    border: 1px solid rgba(40, 59, 105, 0.16);
    border-radius: var(--cc-radius);
    padding: 12px;
}

/* Compare cards */
.tcoCompare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 860px) {
    .tcoCompare {
        grid-template-columns: 1fr;
    }
}

.tcoMiniCard {
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    background: #fbfcff;
    padding: 12px;
}

.tcoMiniHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(40, 59, 105, 0.22);
}

.tcoMiniTitle {
    font-weight: 900;
    color: var(--cc-brand2);
    font-size: 14px;
}

.tcoMiniBadge {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: rgba(40, 59, 105, 0.85);
    padding: 6px 10px;
    border-radius: 999px;
}

/* Yearly block (JS fills it) */
.tcoYearlyWrap {
    margin-top: 12px;
    background: #fff;
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    padding: 12px;
    overflow-x: auto;
}

/* Result components injected by JS */
.tcoResultWrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tcoResultGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 900px) {
    .tcoResultGrid {
        grid-template-columns: 1fr;
    }
}

.tcoKpiCard {
    background: #fff;
    border: 1px solid rgba(40, 59, 105, 0.16);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 25px rgba(16, 24, 40, 0.06);
}

.tcoKpiHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tcoKpiTitle {
    font-weight: 900;
    color: #1f2f55;
    font-size: 14px;
}

.tcoKpiValue {
    font-weight: 900;
    font-size: 22px;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.tcoKpiMeta {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.tcoBadgeMini {
    font-size: 12px;
    color: #fff;
    background: rgba(40, 59, 105, 0.9);
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.tcoBlock {
    background: linear-gradient(180deg,
            rgba(40, 59, 105, 0.08),
            rgba(40, 59, 105, 0.03));
    border: 1px solid rgba(40, 59, 105, 0.16);
    border-radius: 16px;
    padding: 12px 14px;
}

.tcoBlockTitle {
    font-weight: 900;
    color: #1f2f55;
    font-size: 13px;
    margin-bottom: 6px;
}

.tcoBlockMain {
    font-weight: 900;
    font-size: 18px;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.tcoBlockSub {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.tcoRow2 {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tcoRow2>.tcoBlock {
    flex: 1 1 260px;
}

.tcoDiffNote {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* Table styling */
.tcoYearlyWrap table {
    width: 100%;
    min-width: 720px;
    /* 6 колонок */
    border-collapse: collapse;
    font-size: 13px;
}

.tcoYearlyWrap th,
.tcoYearlyWrap td {
    padding: 10px;
    border-top: 1px solid #eef0f6;
    text-align: left;
    vertical-align: top;
}

.tcoYearlyWrap th {
    background: #f7f8fc;
    color: #6b7280;
    font-weight: 900;
}

.tcoYearlyWrap tr.is-win {
    background: rgba(40, 59, 105, 0.06);
}

/* Divider + SEO/Faq */
.cc-divider {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    border-top: 2px dashed rgba(40, 59, 105, 0.35);
}

.cc-seo,
.cc-faq {
    max-width: 900px;
    margin: 20px auto 0;
    padding: 0 16px;
}

.cc-seo h2,
.cc-faq h2 {
    font-size: 22px;
    color: #283b69;
    margin-bottom: 14px;
}

.cc-seo p {
    margin-bottom: 14px;
    line-height: 1.6;
    font-size: 15px;
}

.cc-faq-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.cc-faq-item h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #283b69;
}

.cc-faq-item p {
    font-size: 14px;
    color: #444;
}
/* === TCO: result block below calculator === */

/* вся сітка — 1 колонка */
.tcoCalc .ccalc__grid {
    grid-template-columns: 1fr;
}

/* результат завжди нижче */
.tcoCalc .ccalc__card:nth-child(2) {
    margin-top: 14px;
}
/* ===== TCO: Difference highlight ===== */


/* fallback, не чіпаємо */

.tcoBlockMain {
    position: relative;
}

/* зелена підсвітка */
.tcoBlockMain:contains("EV вигідніше"),
.tcoBlockMain[data-win="ev"] {
    color: #14532d;
}

/* червона підсвітка */
.tcoBlockMain:contains("ДВЗ вигідніше"),
.tcoBlockMain[data-win="ice"] {
    color: #7f1d1d;
}
/* ===== TCO: win/lose colors ===== */

/* highlights */
.tcoBlockMain.is-ev {
    color: #14532d;
}

.tcoBlockMain.is-ice {
    color: #7f1d1d;
}

.tcoKpiCard.is-win {
    border-color: #86efac;
    background: linear-gradient(180deg, #ecfdf5, #ffffff);
}

.tcoKpiCard.is-lose {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fef2f2, #ffffff);
}
/* =========================
   OSCPV look-alike overrides for TCO
   (fonts + inputs + buttons)
   ставити В КІНЕЦЬ tco.css
========================= */

/* labels як в ОСЦПВ */
.tco-page .tcoCalc .ccalc__label {
    font-weight: 900;
    font-size: 13px;
    color: #2b3a55;
}

/* inputs/select як в ОСЦПВ */
.tco-page .tcoCalc .ccalc__input,
.tco-page .tcoCalc select.ccalc__input,
.tco-page .tcoCalc .ccalc__input[type="number"],
.tco-page .tcoCalc .ccalc__input[type="text"] {
    height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #d4d7de;
    background: #fff;
    font-size: 13px;
    outline: none;
    color: #1f2937;
}

/* focus як в ОСЦПВ */
.tco-page .tcoCalc .ccalc__input:focus,
.tco-page .tcoCalc select.ccalc__input:focus {
    border-color: rgba(40, 59, 105, .55);
    box-shadow: 0 0 0 3px rgba(40, 59, 105, .12);
    color: #111827;
}

/* placeholder як в ОСЦПВ */
.tco-page .tcoCalc .ccalc__input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* ===== Buttons як в ОСЦПВ ===== */
.tco-page .tcoCalc .ccalc__btn {
    height: 44px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    padding: 0 14px;
    border: 1px solid #d4d7de;
    background: #fff;
    color: #1f2f55;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* primary як oscpv-btn */
.tco-page .tcoCalc .ccalc__btn.ccalc__btn--primary {
    background: rgba(40, 59, 105, .08);
    border: 1px solid rgba(40, 59, 105, .35);
    color: #1f2f55;
}

.tco-page .tcoCalc .ccalc__btn.ccalc__btn--primary:hover {
    background: rgba(40, 59, 105, .14);
}

/* hover як oscpv-btn-ghost */
.tco-page .tcoCalc .ccalc__btn:hover {
    background: #f6f7fb;
    border-color: #b9c2da;
    box-shadow: 0 4px 12px rgba(31, 47, 85, .08);
}

/* зелені лінки-кнопки (tco-btn-green) — як success в ОСЦПВ */
.tco-page .tcoCalc .ccalc__btn.tco-btn-green {
    background: rgba(34, 197, 94, .10);
    border: 1px solid rgba(34, 197, 94, .35);
    color: #166534;
    font-weight: 900;
    box-shadow: none;
}

.tco-page .tcoCalc .ccalc__btn.tco-btn-green:hover {
    background: rgba(34, 197, 94, .16);
    border-color: rgba(34, 197, 94, .50);
    box-shadow: 0 4px 12px rgba(34, 197, 94, .10);
}

/* Авто-розрахунок (checkbox) — як у ОСЦПВ по тону */
.tco-page .tcoCalc .evc-autocalc {
    font-weight: 900;
    font-size: 13px;
    color: #1f2f55;
}

/* Бонус: вирівняємо висоту кнопок в обох групах */
.tco-page .tcoCalc .tco-actions-left .ccalc__btn,
.tco-page .tcoCalc .tco-actions-right .ccalc__btn {
    height: 44px;
}