:root {
    --ink: #102a2b;
    --ink-soft: #486261;
    --cream: #f5f0e7;
    --paper: #fffdf8;
    --line: #d9dfd8;
    --green: #0a7968;
    --green-dark: #075f53;
    --mint: #d9f3e9;
    --orange: #e76f3d;
    --orange-soft: #fff0e9;
    --red: #ad382d;
    --shadow: 0 24px 70px rgba(25, 58, 54, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: "DM Sans", sans-serif;
    line-height: 1.55;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.site-header {
    width: min(1180px, calc(100% - 40px));
    height: 82px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 19px;
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px 10px 10px 3px;
    display: grid;
    place-items: center;
    background: var(--green);
    color: white;
    font-size: 17px;
}

.header-link {
    color: var(--green-dark);
    font-weight: 700;
    text-underline-offset: 5px;
}

.hero {
    width: min(1180px, calc(100% - 40px));
    min-height: 610px;
    margin: 0 auto;
    padding: 76px 0 92px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 88px;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -80px;
    top: 20px;
    border-radius: 50%;
    background: rgba(217, 243, 233, 0.7);
    filter: blur(2px);
    z-index: -1;
}

.eyebrow {
    color: var(--green);
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
    font-family: "Manrope", sans-serif;
    line-height: 1.15;
}

h1 {
    max-width: 760px;
    margin: 20px 0;
    font-size: clamp(46px, 5.6vw, 76px);
    letter-spacing: -0.055em;
}

h1 em {
    color: var(--green);
    font-style: normal;
}

.hero-lead {
    max-width: 640px;
    margin: 0 0 30px;
    color: var(--ink-soft);
    font-size: 19px;
}

.primary-cta,
.submit-button,
.download-button {
    min-height: 54px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 0 24px;
    background: var(--green);
    color: white;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(10, 121, 104, 0.2);
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

.primary-cta:hover,
.submit-button:hover,
.download-button:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
}

.trust-row {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: var(--ink-soft);
    font-size: 13px;
}

.hero-card {
    min-height: 400px;
    padding: 30px;
    border: 1px solid rgba(16, 42, 43, 0.08);
    border-radius: 28px 28px 28px 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
    transform: rotate(1.5deg);
}

.card-topline,
.preview-metrics,
.section-title,
.results-heading,
.results-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.card-topline {
    font-size: 13px;
    font-weight: 700;
}

.status-pill,
.result-badge {
    border-radius: 999px;
    padding: 6px 12px;
    background: var(--mint);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
}

.preview-label {
    margin: 48px 0 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.preview-profit {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 46px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.preview-chart {
    height: 110px;
    margin: 30px 0;
    display: flex;
    align-items: end;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.preview-chart span {
    flex: 1;
    border-radius: 6px 6px 0 0;
    background: #c7ded8;
}

.preview-chart span.active {
    background: var(--green);
}

.preview-metrics {
    align-items: start;
}

.preview-metrics div {
    display: grid;
    gap: 4px;
}

.preview-metrics small {
    color: var(--ink-soft);
}

.value-strip {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 110px;
    padding: 28px 32px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(16, 42, 43, 0.15);
    border-bottom: 1px solid rgba(16, 42, 43, 0.15);
}

.value-strip article {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.value-strip article + article {
    border-left: 1px solid rgba(16, 42, 43, 0.15);
}

.value-strip span {
    color: var(--orange);
    font-family: "Manrope", sans-serif;
    font-size: 25px;
    font-weight: 800;
}

.value-strip strong {
    display: block;
}

.value-strip p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.calculator-section,
.results-section,
.how-it-works {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto 120px;
}

.section-heading {
    max-width: 720px;
    margin: 0 auto 48px;
    text-align: center;
}

.section-heading h2,
.results-heading h2 {
    margin: 12px 0;
    font-size: clamp(34px, 4vw, 52px);
    letter-spacing: -0.04em;
}

.section-heading p {
    color: var(--ink-soft);
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    align-items: start;
    gap: 26px;
}

.calculator-card {
    overflow: hidden;
    border: 1px solid rgba(16, 42, 43, 0.1);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.form-section {
    padding: 34px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 20px;
}

.form-section + .form-section {
    border-top: 1px solid var(--line);
}

.section-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: white;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 800;
}

.section-content {
    min-width: 0;
}

.section-title {
    align-items: start;
    margin-bottom: 22px;
}

.section-title h3 {
    margin: 0 0 4px;
    font-size: 19px;
}

.section-title p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.section-title > strong {
    white-space: nowrap;
    color: var(--green);
}

.field,
.input-field {
    display: grid;
    gap: 8px;
}

.field > label,
.input-field > span:first-child {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-width: 0;
    height: 48px;
    border: 1px solid #cbd5ce;
    border-radius: 10px;
    padding: 0 13px;
    background: white;
    color: var(--ink);
    outline: none;
    transition: border 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(10, 121, 104, 0.12);
}

.input-with-unit {
    display: flex;
    align-items: center;
    position: relative;
}

.input-with-unit input {
    padding-right: 58px;
}

.currency-symbol {
    position: absolute;
    right: 13px;
    color: var(--ink-soft);
    font-size: 12px;
    pointer-events: none;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.product {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8faf7;
}

.product + .product {
    margin-top: 16px;
}

.product-header {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-header h4 {
    margin: 0;
}

.remove-product {
    border: 0;
    background: transparent;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.product-name-field {
    margin-bottom: 14px;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.secondary-button {
    width: 100%;
    min-height: 46px;
    margin-top: 14px;
    border: 1px dashed #9eb6ad;
    border-radius: 10px;
    background: transparent;
    color: var(--green-dark);
    font-weight: 800;
    cursor: pointer;
}

.secondary-button:hover {
    border-color: var(--green);
    background: rgba(217, 243, 233, 0.35);
}

.email-section small {
    font-weight: 400;
}

.privacy-note {
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
}

.submit-button {
    width: calc(100% - 68px);
    margin: 0 34px 34px;
}

.submit-button:disabled,
.download-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.message {
    margin: 0 34px 20px;
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 14px;
}

.error-message {
    background: #ffebe8;
    color: var(--red);
}

.payment-message {
    background: var(--orange-soft);
    color: var(--ink);
}

.payment-summary {
    margin: 0 34px 18px;
    padding: 18px 20px;
    border: 1px solid #b9d9ce;
    border-radius: 12px;
    background: var(--mint);
}

.payment-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.payment-summary span {
    font-weight: 800;
}

.payment-summary strong {
    color: var(--green-dark);
    font-family: "Manrope", sans-serif;
    font-size: 23px;
    white-space: nowrap;
}

.payment-summary p {
    margin: 7px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.side-note {
    padding: 24px;
    border: 1px solid #b9d9ce;
    border-radius: 16px 16px 16px 4px;
    background: var(--mint);
}

.note-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--green);
    color: white;
    font-family: serif;
    font-weight: 800;
}

.side-note h3 {
    margin: 16px 0 8px;
    font-size: 17px;
}

.side-note p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.results-section {
    scroll-margin-top: 30px;
    padding: 46px;
    border-radius: 26px;
    background: var(--ink);
    color: white;
    box-shadow: var(--shadow);
}

.results-heading {
    align-items: end;
    margin-bottom: 28px;
}

.results-heading h2 {
    margin-bottom: 0;
    font-size: clamp(30px, 4vw, 46px);
}

.results-section .eyebrow {
    color: #7ce0c9;
}

.results-section[data-status="unprofitable"] .result-badge {
    background: var(--orange-soft);
    color: var(--red);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.metric-card {
    min-height: 130px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
}

.metric-card span {
    color: #bacac8;
    font-size: 12px;
}

.metric-card strong {
    font-family: "Manrope", sans-serif;
    font-size: 23px;
}

.metric-card.featured {
    background: var(--green);
}

.metric-card.featured span {
    color: #d8fff4;
}

.profitability-chart {
    margin: 22px 0;
    padding: 26px;
    border-radius: 16px;
    background: var(--paper);
    color: var(--ink);
}

.profitability-chart > h3 {
    margin: 0 0 6px;
    font-size: 24px;
    letter-spacing: -0.025em;
}

.profitability-chart-intro {
    margin: 0 0 26px;
    color: var(--ink-soft);
    font-size: 14px;
}

.profitability-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 42px;
}

.profitability-chart-panel + .profitability-chart-panel {
    padding-left: 42px;
    border-left: 1px solid var(--line);
}

.profitability-chart-panel h4 {
    margin: 0 0 5px;
    font-size: 16px;
}

.profitability-chart-note {
    margin: 0 0 20px;
    color: var(--ink-soft);
    font-size: 12px;
}

.profitability-bar-row + .profitability-bar-row {
    margin-top: 17px;
}

.profitability-bar-labels {
    margin-bottom: 7px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.profitability-bar-labels span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.profitability-bar-labels strong {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.profitability-bar-track {
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7efec;
}

.profitability-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.profitability-bar.is-cost,
.profitability-bar.is-negative {
    background: var(--orange);
}

.company-profit-result {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--mint);
    color: var(--green-dark);
}

.company-profit-result.is-negative {
    background: var(--orange-soft);
    color: var(--red);
}

.company-profit-result.is-balanced {
    background: #edf1ed;
    color: var(--ink-soft);
}

.company-profit-result span {
    font-size: 13px;
    font-weight: 700;
}

.company-profit-result strong {
    font-family: "Manrope", sans-serif;
    font-size: 20px;
    white-space: nowrap;
}

.profitability-legend {
    margin: 20px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    margin: 0 5px 0 13px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot:first-child {
    margin-left: 0;
}

.legend-dot.is-margin {
    background: var(--green);
}

.legend-dot.is-cost {
    background: var(--orange);
}

.visually-hidden {
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    position: absolute;
    border: 0;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.recommendation-card {
    margin: 22px 0;
    padding: 22px;
    border-radius: 14px;
    background: var(--paper);
    color: var(--ink);
}

.recommendation-card span {
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.recommendation-card p {
    margin: 8px 0 0;
}

.results-actions {
    justify-content: start;
}

.download-button {
    box-shadow: none;
}

.reset-button {
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 0 18px;
    background: transparent;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.email-feedback {
    margin: 18px 0 0;
    color: #bacac8;
    font-size: 13px;
}

.how-it-works {
    padding-top: 10px;
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.insight-grid article {
    min-height: 220px;
    padding: 28px;
    border: 1px solid rgba(16, 42, 43, 0.12);
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.7);
}

.insight-grid span {
    color: var(--orange);
    font-family: "Manrope", sans-serif;
    font-weight: 800;
}

.insight-grid h3 {
    margin: 46px 0 8px;
    font-size: 24px;
}

.insight-grid p {
    margin: 0;
    color: var(--ink-soft);
}

footer {
    min-height: 220px;
    padding: 52px max(20px, calc((100% - 1180px) / 2));
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 24px;
    background: #e5e9e1;
    color: var(--ink-soft);
}

.footer-brand {
    color: var(--ink);
}

footer p {
    text-align: center;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 50px;
        padding-top: 54px;
    }

    .hero-copy {
        text-align: center;
    }

    .hero-lead,
    .trust-row {
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }

    .hero-card {
        width: min(520px, 100%);
        margin: auto;
        transform: none;
    }

    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .side-note {
        order: -1;
    }

    .result-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profitability-chart-grid {
        grid-template-columns: 1fr;
    }

    .profitability-chart-panel + .profitability-chart-panel {
        padding-top: 26px;
        padding-left: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }
}

@media (max-width: 680px) {
    .site-header,
    .hero,
    .value-strip,
    .calculator-section,
    .results-section,
    .how-it-works {
        width: min(100% - 28px, 1180px);
    }

    .header-link {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 42px 0 70px;
    }

    h1 {
        font-size: 42px;
    }

    .hero-lead {
        font-size: 17px;
    }

    .value-strip,
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .value-strip {
        gap: 20px;
    }

    .value-strip article {
        justify-content: start;
    }

    .value-strip article + article {
        border-left: 0;
    }

    .form-section {
        padding: 24px 18px;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 12px;
    }

    .field-grid,
    .product-grid,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        display: grid;
    }

    .submit-button {
        width: calc(100% - 36px);
        margin: 0 18px 24px;
    }

    .message {
        margin-left: 18px;
        margin-right: 18px;
    }

    .payment-summary {
        margin-right: 18px;
        margin-left: 18px;
    }

    .results-section {
        padding: 28px 20px;
    }

    .profitability-chart {
        padding: 20px 18px;
    }

    .results-heading,
    .results-actions {
        align-items: start;
        flex-direction: column;
    }

    footer {
        grid-template-columns: 1fr;
        text-align: center;
    }

    footer .brand {
        justify-content: center;
    }

    footer p {
        margin: 0;
    }
}
