:root {
    --bg-color: #f5f2ed;
    --surface: #fffdfa;
    --surface-muted: #eee9e1;
    --surface-strong: #1a1a1a;
    --border-color: rgba(26, 26, 26, 0.12);
    --border-strong: rgba(26, 26, 26, 0.22);
    --text-primary: #1a1a1a;
    --text-secondary: #6f6a62;
    --text-tertiary: #9b948b;
    --accent: #c1272d;
    --accent-soft: rgba(193, 39, 45, 0.09);
    --accent-hover: #981f24;
    --shadow-soft: 0 20px 60px rgba(39, 35, 30, 0.08);
    --shadow-tight: 0 8px 24px rgba(39, 35, 30, 0.08);

    --font-heading: "Instrument Serif", Georgia, "Times New Roman", serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg-color);
}

body {
    background:
        linear-gradient(180deg, rgba(255, 253, 250, 0.56), rgba(245, 242, 237, 0) 420px),
        var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input {
    font: inherit;
}

/* Nav */
.navbar {
    background: rgba(245, 242, 237, 0.82);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
    min-height: 44px;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.08), 0 8px 18px rgba(26, 26, 26, 0.08);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.55rem;
    letter-spacing: -0.01em;
}

.brand-kicker,
.nav-subtitle,
.eyebrow,
.sub-options-title {
    font-size: 0.68rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-kicker,
.nav-subtitle {
    color: var(--text-secondary);
}

.nav-subtitle {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 253, 250, 0.58);
}

/* Layout */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 4.5rem 2rem 3.25rem;
    gap: 4rem;
}

.config-panel {
    min-width: 0;
}

.summary-panel {
    min-width: 0;
}

/* Header */
.header {
    margin-bottom: 3.5rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--accent);
    margin-bottom: 1.1rem;
}

.eyebrow::before {
    content: "";
    width: 34px;
    height: 1px;
    background: currentColor;
}

.title {
    font-family: var(--font-heading);
    font-size: clamp(3.4rem, 7vw, 6.6rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    line-height: 0.92;
    max-width: 720px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.08rem;
    letter-spacing: 0;
    font-weight: 400;
    max-width: 620px;
}

.quick-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.65rem;
}

.quick-specs span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 253, 250, 0.6);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Modules */
.modules-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.module-card {
    background: rgba(255, 253, 250, 0.86);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-tight);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(193, 39, 45, 0.2);
    box-shadow: var(--shadow-soft);
}

.module-card.disabled {
    opacity: 0.56;
    background: rgba(238, 233, 225, 0.62);
    box-shadow: none;
}

.module-card.disabled .module-header {
    pointer-events: auto;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
}

.module-body {
    padding: 0 1.5rem 1.5rem;
}

.module-card.disabled .module-body {
    display: none;
}

.module-base-price {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.22rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.module-base-price .subtext {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.module-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.62;
    margin-top: -0.15rem;
    max-width: 62ch;
}

.hypothetical-list {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(238, 233, 225, 0.54);
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.hypothetical-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
}

.hypothetical-list ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.hypothetical-list li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: grid;
    grid-template-columns: 6px minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
}

.hypothetical-list li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.72;
    margin-top: 0.55em;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 1.35rem 0;
}

/* Forms & Inputs */
.custom-checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.custom-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 25px;
    width: 25px;
    background-color: transparent;
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 14px;
    flex-shrink: 0;
    position: relative;
}

.custom-checkbox-container:hover .checkmark {
    border-color: var(--accent);
    transform: scale(1.04);
}

.custom-checkbox-container input:focus-visible~.checkmark {
    outline: 3px solid rgba(193, 39, 45, 0.18);
    outline-offset: 3px;
}

.custom-checkbox-container input:checked~.checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox-container input:checked~.checkmark:after {
    display: block;
}

.custom-checkbox-container .checkmark:after {
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.label-text {
    font-family: var(--font-body);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.config-row-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.inline-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.apple-input {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.65rem 0.85rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    width: 92px;
    min-height: 44px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.apple-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(193, 39, 45, 0.12);
}

/* Sub Options */
.sub-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sub-options-title {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.sub-option {
    padding: 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.2s;
    background: transparent;
}

.sub-option:hover {
    border-color: var(--accent);
}

.sub-option input:checked~.sub-option-content .label-text {
    color: var(--accent);
}

.sub-option .label-text {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0;
    transition: color 0.2s;
}

.sub-option-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.price-add {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Summary Panel */
.summary-sticky {
    position: sticky;
    top: 6rem;
    background: var(--surface-strong);
    color: #f5f2ed;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(26, 26, 26, 0.18);
    padding: 1.55rem;
    display: flex;
    flex-direction: column;
}

.summary-header {
    border-bottom: 1px solid rgba(245, 242, 237, 0.14);
    padding-bottom: 1.35rem;
    margin-bottom: 1.5rem;
}

.summary-header h2 {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.01em;
}

.summary-header p {
    color: rgba(245, 242, 237, 0.58);
    font-size: 0.78rem;
    margin-top: 0.5rem;
}

.summary-content {
    flex-grow: 1;
}

.line-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 150px;
}

.line-item {
    display: flex;
    flex-direction: column;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(245, 242, 237, 0.1);
}

.line-item-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #fffdfa;
    font-weight: 600;
    font-size: 0.96rem;
}

.line-item-top span:last-child {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.line-item-detail {
    color: rgba(245, 242, 237, 0.55);
    font-size: 0.82rem;
    margin-top: 0.25rem;
    line-height: 1.42;
}

.empty-state {
    color: rgba(245, 242, 237, 0.58);
    font-size: 0.94rem;
    text-align: center;
    margin-top: 2rem;
}

.summary-footer {
    border-top: 1px solid rgba(245, 242, 237, 0.14);
    padding-top: 1.55rem;
    margin-top: 1.2rem;
}

.total-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.total-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: rgba(245, 242, 237, 0.82);
}

.total-value {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 0.9;
    color: #fffdfa;
}

.tax-note {
    font-size: 0.78rem;
    color: rgba(245, 242, 237, 0.52);
}

.site-footer {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

.proposal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 44px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 180ms ease, transform 180ms ease;
}

.proposal-link strong {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 400;
    position: relative;
}

.proposal-link strong::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 220ms ease;
}

.proposal-link:hover,
.proposal-link:focus-visible {
    color: var(--accent);
    transform: translateY(-1px);
}

.proposal-link:hover strong::after,
.proposal-link:focus-visible strong::after {
    transform: scaleX(1);
    transform-origin: left;
}

.proposal-link:focus-visible {
    outline: 3px solid rgba(193, 39, 45, 0.18);
    outline-offset: 4px;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .nav-content {
        padding: 0.75rem 1.25rem;
    }

    .nav-subtitle {
        display: none;
    }

    .layout {
        grid-template-columns: 1fr;
        padding: 2.35rem 1.25rem 2rem;
        gap: 2rem;
    }

    .summary-panel {
        order: -1;
    }

    .summary-sticky {
        position: static;
        padding: 1.25rem;
        border-radius: 18px;
    }

    .title {
        font-size: clamp(3.2rem, 14vw, 4.8rem);
    }

    .header {
        margin-bottom: 2rem;
    }

    .module-header {
        align-items: flex-start;
        padding: 1.2rem;
    }

    .module-body {
        padding: 0 1.2rem 1.2rem;
    }

    .config-row-inline {
        align-items: flex-start;
        flex-direction: column;
    }

    .apple-input {
        width: 100%;
    }

    .site-footer {
        padding: 0 1.25rem 2.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
