/* ==========================================================================
   KALKULATOR POMPA — Sahabat Purchasing
   Memakai token warna/ukuran dari index.css.
   ========================================================================== */

/* ========== 1. HALAMAN & HEADER ========== */

.calc-page {
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(18, 182, 227, .12), transparent 70%),
        var(--bg);
    min-height: 100vh;
}

.calc-header {
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}

.calc-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 20px;
}

.calc-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
}

.calc-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.calc-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.calc-brand-text strong {
    font-size: .98rem;
    font-weight: 800;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.calc-brand-text small {
    color: var(--ink-3);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.calc-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-nav-link {
    padding: 9px 12px;
    color: var(--ink-2);
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--pill);
    transition: background-color .2s ease, color .2s ease;
}

.calc-nav-link:hover {
    color: var(--brand);
    background: rgba(43, 63, 212, .08);
}

.calc-nav .btn {
    padding: 10px 18px;
    font-size: .86rem;
    color: #fff;
    background: linear-gradient(135deg, #16a34a, #0b7a43);
}

/* ========== 2. HERO ========== */

.calc-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(30px, 4.6vw, 54px) 20px clamp(28px, 4.2vw, 48px);
    color: #fff;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 52%, var(--cyan) 100%);
}

.calc-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(560px 260px at 8% -20%, rgba(255, 255, 255, .22), transparent 68%),
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: auto, 44px 44px, 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 35% 0%, #000 0%, transparent 78%);
    mask-image: radial-gradient(circle at 35% 0%, #000 0%, transparent 78%);
    pointer-events: none;
}

.calc-hero .container {
    position: relative;
    z-index: 1;
}

.calc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 6px 14px;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: var(--pill);
}

.calc-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.7rem, 3.8vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.calc-lead {
    max-width: 66ch;
    margin: 0;
    color: rgba(255, 255, 255, .92);
    font-size: clamp(.95rem, 1.6vw, 1.05rem);
}

.calc-hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.calc-hero-points li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .92);
}

.calc-hero-points li::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .25);
}

/* ========== 3. RINGKASAN ========== */

.calc-main {
    padding-top: clamp(20px, 3vw, 30px);
    padding-bottom: 20px;
}

.calc-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
}

.sum-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.sum-label {
    color: var(--ink-3);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.sum-value {
    color: var(--brand-ink);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.sum-actions {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 10px;
}

.sum-actions .btn {
    padding: 11px 20px;
    font-size: .87rem;
}

.sum-actions .btn-wa {
    color: #fff;
    background: linear-gradient(135deg, #16a34a, #0b7a43);
    box-shadow: 0 10px 24px -14px rgba(11, 122, 67, .9);
}

.sum-actions .btn-outline {
    background: #fff;
}

/* ========== 4. TAB ========== */

.calc-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    gap: 6px;
    margin: 16px 0 18px;
    padding: 6px;
    overflow-x: auto;
    background: rgba(245, 247, 251, .94);
    border: 1px solid var(--line);
    border-radius: var(--pill);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    scrollbar-width: thin;
}

.calc-tab {
    flex: 0 0 auto;
    padding: 10px 18px;
    color: var(--ink-2);
    font-family: inherit;
    font-size: .87rem;
    font-weight: 700;
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-radius: var(--pill);
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.calc-tab:hover {
    color: var(--brand);
    background: rgba(43, 63, 212, .08);
}

.calc-tab[aria-selected="true"] {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: var(--sh-brand);
}

/* ========== 5. PANEL ========== */

.calc-panel[hidden],
[hidden] {
    display: none !important;
}

.calc-split {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: 18px;
    align-items: start;
}

.panel-card {
    padding: clamp(16px, 2.4vw, 24px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
}

.panel-card--result {
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
}

.panel-head {
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.015em;
}

.panel-head p {
    margin: 0;
    color: var(--ink-3);
    font-size: .86rem;
    line-height: 1.55;
}

/* ========== 6. FORM ========== */

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.field--full {
    grid-column: 1 / -1;
    margin-bottom: 12px;
}

.field-label {
    color: var(--ink-2);
    font-size: .78rem;
    font-weight: 700;
}

.calc-input {
    width: 100%;
    padding: 10px 12px;
    color: var(--ink);
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid #d8e0ee;
    border-radius: var(--r-sm);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.calc-input:hover {
    border-color: #b9c6dd;
}

.calc-input:focus {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 3px rgba(43, 63, 212, .16);
}

select.calc-input {
    padding-right: 30px;
    cursor: pointer;
}

.field--check {
    flex-direction: row;
    align-items: center;
    gap: 9px;
    align-self: end;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
}

.field--check input {
    width: 17px;
    height: 17px;
    accent-color: var(--brand);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.btn-row .btn {
    padding: 11px 20px;
    font-size: .88rem;
}

/* ========== 7. HASIL ========== */

.result-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-bottom: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(43, 63, 212, .09), rgba(18, 182, 227, .12));
    border: 1px solid rgba(43, 63, 212, .16);
    border-radius: var(--r-sm);
}

.result-label {
    flex: 1 0 100%;
    color: var(--ink-3);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.result-big {
    color: var(--brand-ink);
    font-size: clamp(1.7rem, 3.4vw, 2.15rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.result-unit {
    color: var(--ink-2);
    font-size: .88rem;
    font-weight: 700;
}

.result-hero--stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.result-title {
    color: var(--brand-ink);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
}

.result-subhead {
    margin: 16px 0 6px;
    color: var(--ink);
    font-size: .86rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.result-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.result-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed #e6ecf5;
}

.result-row:last-child {
    border-bottom: 0;
}

.result-row dt {
    color: var(--ink-2);
    font-size: .84rem;
}

.result-row dd {
    margin: 0;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.result-list--tight .result-row {
    padding: 6px 0;
}

.result-list--tight .result-row dt {
    font-size: .78rem;
}

.result-list--tight .result-row dd {
    font-size: .84rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.metric span {
    color: var(--ink-3);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.metric strong {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.metric--accent {
    background: linear-gradient(135deg, rgba(43, 63, 212, .1), rgba(18, 182, 227, .13));
    border-color: rgba(43, 63, 212, .2);
}

.metric--accent strong {
    color: var(--brand-ink);
}

/* ========== 8. BAR CHART HEAD ========== */

.bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.bar-row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.bar-row > span {
    color: var(--ink-2);
    font-size: .76rem;
    font-weight: 600;
}

.bar-track {
    height: 12px;
    overflow: hidden;
    background: #eef2f9;
    border-radius: var(--pill);
}

.bar-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--brand-dark), var(--brand));
    border-radius: var(--pill);
    transition: width .35s cubic-bezier(.22, 1, .36, 1);
}

.bar-fill--cyan {
    background: linear-gradient(90deg, #0e8fb5, var(--cyan));
}

.bar-fill--soft {
    background: linear-gradient(90deg, #7c8cf0, #a5b4fc);
}

.bar-fill--gold {
    background: linear-gradient(90deg, #d97706, var(--gold));
}

/* ========== 9. BADGE & CATATAN ========== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: center;
    margin-left: auto;
    padding: 5px 12px;
    color: var(--ink-2);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .02em;
    background: #eef2f9;
    border: 1px solid var(--line);
    border-radius: var(--pill);
    white-space: nowrap;
}

.badge--ok {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.badge--warn {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

.badge--bad {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.calc-note {
    margin: 14px 0 0;
    padding: 10px 12px;
    color: var(--ink-2);
    font-size: .8rem;
    line-height: 1.55;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.calc-note--warn {
    border-left-color: var(--gold);
    background: #fffbeb;
}

/* ========== 10. GRAFIK ========== */

.chart-wrap {
    margin-bottom: 16px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.chart-wrap canvas {
    display: block;
    width: 100%;
    height: 280px;
}

.chart-caption {
    margin: 8px 4px 0;
    color: var(--ink-3);
    font-size: .74rem;
    line-height: 1.5;
}

/* ========== 11. DAFTAR ALASAN ========== */

.reason-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reason-list li {
    position: relative;
    padding-left: 22px;
    color: var(--ink-2);
    font-size: .84rem;
    line-height: 1.55;
}

.reason-list li::before {
    content: "";
    position: absolute;
    top: .45em;
    left: 4px;
    width: 7px;
    height: 7px;
    background: var(--brand);
    border-radius: 50%;
}

.reason-list--alt li::before {
    background: var(--cyan);
}

/* ========== 12. NOZZLE ========== */

.nozzle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}

.nozzle-card {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.nozzle-card h3 {
    margin: 0 0 6px;
    color: var(--ink-2);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.nozzle-dn {
    display: block;
    color: var(--brand-ink);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.nozzle-nps {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-3);
    font-size: .82rem;
    font-weight: 700;
}

.nozzle-card .badge {
    margin: 8px 0 0;
}

/* ========== 13. REFERENSI ========== */

.calc-ref {
    margin-top: clamp(30px, 5vw, 48px);
}

.ref-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.ref-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
}

.ref-card h3 {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: .98rem;
    font-weight: 800;
}

.ref-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0;
}

.ref-list > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ref-list dt {
    color: var(--ink-3);
    font-size: .76rem;
    font-weight: 700;
}

.ref-list dd {
    margin: 0;
    color: var(--ink);
    font-size: .8rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.ref-list code {
    padding: 2px 6px;
    color: var(--brand-ink);
    font-family: "Cascadia Code", Consolas, "Courier New", monospace;
    font-size: .78rem;
    background: #f1f5fd;
    border: 1px solid #e2e9f7;
    border-radius: 6px;
}

.ref-bullets {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ref-bullets li {
    position: relative;
    padding-left: 20px;
    color: var(--ink-2);
    font-size: .84rem;
    line-height: 1.55;
}

.ref-bullets li::before {
    content: "";
    position: absolute;
    top: .45em;
    left: 3px;
    width: 7px;
    height: 7px;
    background: linear-gradient(135deg, var(--brand), var(--cyan));
    border-radius: 2px;
}

/* ========== 14. CTA & FOOTER ========== */

.calc-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: clamp(28px, 4vw, 44px);
    padding: clamp(22px, 3.4vw, 34px);
    color: #fff;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand) 55%, var(--cyan));
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
}

.calc-cta h2 {
    margin: 0 0 4px;
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -.015em;
}

.calc-cta p {
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font-size: .9rem;
}

.calc-cta .btn {
    flex: 0 0 auto;
    color: #0b7a43;
    background: #fff;
    box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .7);
}

.calc-footer {
    margin-top: clamp(34px, 5vw, 52px);
    padding: 22px 0;
    color: #94a3b8;
    background: #0f172a;
    border-top: 3px solid var(--brand);
}

.calc-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 20px;
}

.calc-footer p {
    margin: 0;
    font-size: .82rem;
}

.calc-footer a {
    color: #cbd5e1;
    font-weight: 600;
    text-decoration: none;
}

.calc-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ========== 15. TOAST ========== */

.calc-toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    z-index: 3000;
    max-width: min(90vw, 380px);
    padding: 11px 20px;
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
    background: #0f172a;
    border-radius: var(--pill);
    box-shadow: 0 18px 34px -16px rgba(15, 23, 42, .8);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity .24s ease, transform .24s ease;
}

.calc-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ========== 16. RESPONSIF ========== */

@media (max-width: 980px) {
    .calc-split {
        grid-template-columns: 1fr;
    }

    .calc-tabs {
        gap: 4px;
        padding: 5px;
    }

    .calc-tab {
        padding: 9px 13px;
        font-size: .81rem;
    }

    .ref-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ref-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .calc-summary {
        grid-template-columns: 1fr 1fr;
        padding: 12px;
    }

    .calc-header-inner {
        padding: 10px 16px;
    }

    .calc-nav-link {
        display: none;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 92px minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .calc-header-inner {
        flex-wrap: wrap;
    }

    .calc-brand-text small {
        display: none;
    }

    .calc-brand-text strong {
        font-size: .92rem;
    }

    .calc-hero-points {
        flex-direction: column;
        gap: 6px;
    }

    .nozzle-grid {
        grid-template-columns: 1fr;
    }

    .ref-grid {
        grid-template-columns: 1fr;
    }

    .ref-card:last-child {
        grid-column: auto;
    }

    .sum-actions .btn {
        flex: 1 1 100%;
    }

    .calc-cta .btn {
        width: 100%;
    }

    .result-row {
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .calc-summary {
        grid-template-columns: 1fr;
    }

    .calc-brand-text strong {
        font-size: .84rem;
    }

    .calc-nav .btn {
        padding: 9px 14px;
        font-size: .8rem;
    }
}

/* ========== 17. CETAK ========== */

@media print {
    .calc-page {
        background: #fff;
    }

    .calc-header,
    .calc-hero,
    .calc-tabs,
    .sum-actions,
    .btn-row,
    .calc-cta,
    .calc-footer,
    .calc-toast,
    .skip-link {
        display: none !important;
    }

    .calc-summary {
        position: static;
        border-color: #ccc;
        box-shadow: none;
    }

    .calc-panel[hidden] {
        display: block !important;
    }

    .calc-split {
        grid-template-columns: 1fr;
    }

    .panel-card,
    .ref-card,
    .metric,
    .sum-card,
    .result-hero {
        break-inside: avoid;
        box-shadow: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .chart-wrap {
        break-inside: avoid;
    }

    .calc-panel {
        margin-bottom: 16px;
    }
}
