/* Help to Buy Calculator, calculator-specific layer.
   All brand styling comes from ds/styles.css (Raynor Lending design pack).
   This file is layout glue plus the calculator's own components, using
   brand tokens only. Neutral grays follow the pack's own usage. */

* { box-sizing: border-box; }

body { margin: 0; }

.shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- hero ---------- */

.hero-pad { padding: 56px 0 96px; }

.hero-title {
    color: #fff;
    font-size: clamp(1.9rem, 4.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 14px 0 10px;
}

.hero-lede {
    color: rgba(255, 255, 255, 0.85);
    max-width: 62ch;
    margin: 0 0 28px;
    font-size: 1.0625rem;
}

.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 560px;
}

.mode-button {
    text-align: left;
    padding: 14px 18px;
    border-radius: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-button:hover { border-color: rgba(255, 255, 255, 0.7); }

.mode-button.active {
    background: #fff;
    border-color: var(--brand-gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.mode-button:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 2px; }

.mode-title { display: block; font-weight: 600; font-size: 1rem; color: #fff; }
.mode-button.active .mode-title { color: var(--brand-navy); }
.mode-sub { display: block; font-size: 0.8125rem; color: rgba(255, 255, 255, 0.75); margin-top: 2px; }
.mode-button.active .mode-sub { color: #6b7280; }

/* ---------- layout ---------- */

.layout {
    display: grid;
    grid-template-columns: minmax(320px, 5fr) minmax(380px, 7fr);
    gap: 24px;
    align-items: start;
    margin-top: -48px;
    padding-bottom: 64px;
    position: relative;
    z-index: 1;
}

@media (max-width: 880px) {
    .layout { grid-template-columns: 1fr; }
}

/* ---------- panels ---------- */

.panel-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.inputs .panel-card + .panel-card { margin-top: 16px; }
.results .panel-card + .panel-card { margin-top: 16px; }

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head h2 { margin: 0; font-size: 1.125rem; font-weight: 700; }

.panel-step {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-secondary-blue) 100%);
    box-shadow: 0 8px 20px rgba(26, 54, 93, 0.25);
    color: #fff;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
    flex: none;
}

/* ---------- fields ---------- */

.field { margin-top: 1.25rem; }

.field-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--brand-navy);
    margin-bottom: 6px;
}

.hint { font-size: 0.8125rem; color: #6b7280; margin: 6px 0 0; }
.hint-inline { display: block; font-size: 0.75rem; font-weight: 400; color: #6b7280; }

select {
    width: 100%;
    height: 3rem;
    padding: 0 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    font-size: 1rem;
    color: var(--brand-dark-gray);
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(243, 209, 146, 0.2), 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* segmented radios */

.segmented { display: flex; gap: 8px; flex-wrap: wrap; }

.segmented label { position: relative; flex: 1; min-width: 90px; }

.segmented input { position: absolute; opacity: 0; inset: 0; }

.segmented span {
    display: block;
    text-align: center;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.segmented-tall span .service-highlight { margin-top: 4px; }

.segmented input:checked + span {
    border-color: var(--brand-gold);
    background: rgba(234, 179, 8, 0.06);
    color: var(--brand-navy);
    font-weight: 600;
}

.segmented input:focus-visible + span { outline: 2px solid var(--brand-gold); outline-offset: 2px; }

.segmented label.disabled span { opacity: 0.45; cursor: not-allowed; }

/* switch */

.switch-field { margin-top: 1.25rem; }

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--brand-navy);
}

.switch { position: relative; flex: none; width: 46px; height: 26px; }

.switch input { position: absolute; opacity: 0; inset: 0; }

.knob {
    position: absolute;
    inset: 0;
    border-radius: 13px;
    background: #d1d5db;
    transition: background 0.3s ease;
}

.knob::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.switch input:checked + .knob {
    background: linear-gradient(135deg, var(--brand-gold) 0%, #E7C675 100%);
}

.switch input:checked + .knob::after { transform: translateX(20px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

/* banners */

.banner {
    border-radius: 0.75rem;
    padding: 10px 14px;
    font-size: 0.875rem;
    margin-top: 12px;
    border: 1px solid;
}

.banner.ok { background: rgba(107, 142, 107, 0.1); border-color: var(--brand-soft-green); color: var(--brand-navy); }
.banner.warning { background: rgba(216, 135, 33, 0.08); border-color: var(--brand-orange); color: var(--brand-dark-gray); }
.banner.error { background: rgba(216, 135, 33, 0.12); border-color: var(--brand-orange); color: var(--brand-dark-gray); }
.banner.info { background: rgba(68, 107, 145, 0.08); border-color: var(--brand-secondary-blue); color: var(--brand-dark-gray); }

/* details */

details.more {
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
    margin-top: 20px;
}

details.more summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--brand-secondary-blue);
}

details.more summary:hover { color: var(--brand-navy); }

details.more ul { margin: 10px 0 0; padding-left: 22px; font-size: 0.875rem; color: #4b5563; }
details.more li { margin-bottom: 4px; }

.fine-tune-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.fine-tune-grid .span-2 { grid-column: span 2; }

/* ---------- results ---------- */

.results { position: sticky; top: 20px; }

@media (max-width: 880px) { .results { position: static; } }

.results-heading { margin: 14px 0 18px; font-size: 1.375rem; font-weight: 700; }

.hero { margin: 14px 0 20px; }

.hero-number {
    font-size: clamp(2.25rem, 6vw, 3.25rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    margin: 0;
}

.hero-caption { color: #6b7280; margin: 6px 0 0; font-size: 0.9375rem; }

/* funding stack */

.stack { margin-bottom: 20px; }

.stack-bar {
    display: flex;
    height: 52px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--brand-light-gray);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.seg { transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1); min-width: 0; }

@media (prefers-reduced-motion: reduce) { .seg { transition: none; } }

.seg-you { background: linear-gradient(135deg, var(--brand-gold) 0%, #E7C675 100%); }
.seg-gov { background: var(--brand-soft-green); }
.seg-loan { background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-secondary-blue) 100%); }

.stack-bar.example .seg-you { background: var(--brand-light-gold); }

.stack-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 10px;
    font-size: 0.8125rem;
    color: #4b5563;
}

.stack-legend b { color: var(--brand-navy); font-variant-numeric: tabular-nums; }

.dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 3px;
    margin-right: 6px;
}

.dot-you { background: var(--brand-gold); }
.dot-gov { background: var(--brand-soft-green); }
.dot-loan { background: var(--brand-navy); }

/* limiting-factor quote box */

.limiting { margin-bottom: 20px; }
.limiting-title { margin: 0 0 6px; font-weight: 600; font-size: 1.0625rem; }
.limiting-text { margin: 0; color: #4b5563; font-size: 0.9375rem; }

/* result panels */

.result-panel { border-top: 1px solid #e5e7eb; padding-top: 18px; margin-bottom: 20px; }

.result-panel h3 { margin: 0 0 12px; font-size: 1rem; font-weight: 700; }

.rows { margin: 0; }

.rows > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    font-size: 0.9375rem;
}

.rows > div + div { border-top: 1px dashed #e5e7eb; }

.rows dt { color: #4b5563; margin: 0; }
.rows dt small { display: block; font-size: 0.75rem; color: #6b7280; }
.rows dd { margin: 0; font-weight: 600; color: var(--brand-navy); font-variant-numeric: tabular-nums; white-space: nowrap; }

.rows > div.total { border-top: 2px solid var(--brand-gold); font-weight: 600; }
.rows > div.total dt { color: var(--brand-navy); }

.rows dd.good { color: var(--brand-soft-green); }
.rows dd.bad { color: var(--brand-orange); }

.repayment-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

.repayment-amount { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.repayment-caption { color: #6b7280; font-size: 0.875rem; }

.ongoing-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 480px) { .ongoing-cols { grid-template-columns: 1fr; } }

.ongoing-cols h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-secondary-blue);
    margin: 0 0 6px;
}

.ongoing-cols ul { margin: 0; padding-left: 18px; font-size: 0.8125rem; color: #4b5563; }
.ongoing-cols li { margin-bottom: 3px; }

/* verdict & checks (mode 2) */

.verdict { margin: 14px 0 20px; }

.checks { list-style: none; margin: 0; padding: 0; }

.checks li {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.9375rem;
    border-bottom: 1px dashed #e5e7eb;
}

.checks li:last-child { border-bottom: 0; }

.check-icon {
    flex: none;
    width: 22px; height: 22px;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 22px;
    text-align: center;
    font-weight: 700;
    margin-top: 1px;
}

.check-icon.pass { background: rgba(107, 142, 107, 0.15); color: var(--brand-soft-green); }
.check-icon.fail { background: rgba(216, 135, 33, 0.15); color: var(--brand-orange); }
.check-icon.unknown { background: var(--brand-light-gray); color: #6b7280; }

.checks .check-detail { display: block; font-size: 0.8125rem; color: #6b7280; }

/* warnings & suggestions */

.warnings:not(:empty) { margin-bottom: 20px; }

.warning-item {
    font-size: 0.875rem;
    border-radius: 0.75rem;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-left: 4px solid;
}

.warning-item.warning { background: rgba(216, 135, 33, 0.08); border-color: var(--brand-orange); color: var(--brand-dark-gray); }
.warning-item.info { background: rgba(68, 107, 145, 0.08); border-color: var(--brand-secondary-blue); color: var(--brand-dark-gray); }

.suggestions { margin: 0; padding-left: 20px; color: #4b5563; font-size: 0.9375rem; }
.suggestions li { margin-bottom: 6px; }

/* CTA card (navy gradient via .hero-section) */

.cta-card {
    border-radius: 16px;
    padding: 28px;
    margin-top: 16px;
    box-shadow: 0 10px 30px rgba(26, 54, 93, 0.25);
}

.cta-card h3 { color: #fff; margin: 0 0 8px; font-size: 1.25rem; font-weight: 700; }
.cta-card p { color: rgba(255, 255, 255, 0.85); margin: 0 0 18px; font-size: 0.9375rem; }

.cta-contact { margin: 14px 0 0; font-size: 0.875rem; }
.cta-contact a { color: var(--brand-light-gold); text-decoration: none; }
.cta-contact a:hover { text-decoration: underline; }

/* ---------- education layer ---------- */

.info-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 9999px;
    border: 1px solid var(--brand-secondary-blue);
    background: #fff;
    color: var(--brand-secondary-blue);
    font-size: 0.6875rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    vertical-align: text-bottom;
    margin-left: 4px;
    padding: 0;
    transition: all 0.3s ease;
}

.info-dot:hover, .info-dot[aria-expanded="true"] {
    background: var(--brand-secondary-blue);
    color: #fff;
}

.info-dot:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 2px; }

.term-note {
    background: var(--brand-light-gray);
    border-left: 4px solid var(--brand-secondary-blue);
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 12px 16px;
    margin: 10px 0 4px;
    font-size: 0.875rem;
}

.term-note strong {
    display: block;
    font-family: 'Poppins', sans-serif;
    color: var(--brand-navy);
    margin-bottom: 4px;
}

.term-note p { margin: 0; color: #4b5563; }

.term-note .term-example {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d1d5db;
    color: #6b7280;
    font-size: 0.8125rem;
}

.buffer-note {
    font-size: 0.8125rem;
    color: #4b5563;
    background: rgba(68, 107, 145, 0.06);
    border-radius: 0.75rem;
    padding: 10px 14px;
    margin: 0 0 14px;
}

/* growth panel */

.future-lede { font-size: 0.875rem; color: #6b7280; margin: 0 0 12px; }

.future-slider-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.future-growth-label {
    font-weight: 700;
    color: var(--brand-navy);
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    text-align: right;
}

input[type="range"]#growth {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--brand-light-gray), var(--brand-light-gold));
    outline: none;
}

input[type="range"]#growth::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-gold) 0%, #E7C675 100%);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

input[type="range"]#growth::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-gold);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

input[type="range"]#growth:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 4px; }

.future-track {
    background: var(--brand-light-gray);
    border-radius: 0.75rem;
    padding: 0;
}

.future-bar {
    height: 34px;
    transition: width 0.25s ease;
    min-width: 30%;
}

.future-text { font-size: 0.875rem; color: #4b5563; margin: 12px 0 0; }

/* try-it button */

.try-button {
    margin-top: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--brand-navy);
    background: #fff;
    border: 2px solid var(--brand-gold);
    border-radius: 0.75rem;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.try-button:hover {
    background: linear-gradient(135deg, var(--brand-gold) 0%, #E7C675 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(243, 209, 146, 0.25);
}

.try-button:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

/* disclaimer */

.disclaimer { margin-top: 16px; padding: 0 8px; font-size: 0.75rem; color: #6b7280; }
.disclaimer a { color: var(--brand-secondary-blue); }
.disclaimer p { margin: 0 0 6px; }
