* {
    box-sizing: border-box;
}

:root {
    --background: #f5f7f2;
    --surface: #ffffff;
    --text: #172019;
    --muted: #66706a;
    --border: #dce2dc;
    --accent: #315c45;
    --accent-dark: #244634;
    --soft: #edf4ee;
    --warning: #fff7df;
    --warning-border: #ead28a;
    --shadow: 0 10px 30px rgba(20, 35, 25, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(100% - 32px, 760px);
    margin: 0 auto;
    padding: 24px 0 48px;
}

.hero {
    padding: 8px 0 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 28px;
    font-size: 0.95rem;
    font-weight: 700;
}

.brand-icon {
    width: 28px;
    height: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

h1 {
    max-width: 650px;
    margin: 0;
    font-size: clamp(2rem, 8vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.intro {
    max-width: 620px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.card {
    margin-top: 18px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.2;
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.step {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: var(--soft);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
}

.form-group {
    margin-bottom: 22px;
}

.form-group:last-of-type {
    margin-bottom: 26px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.help-text {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 0.88rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
}

.input-wrapper > span {
    padding-left: 14px;
    color: var(--muted);
    font-weight: 600;
}

input,
select {
    width: 100%;
    min-height: 50px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
}

input {
    padding: 10px 14px 10px 8px;
}

select {
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23172019' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 17px) center;
    background-size: 12px 8px;
    appearance: none;
    -webkit-appearance: none;
}

.input-wrapper:focus-within,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 92, 69, 0.12);
}

button[type="submit"] {
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    font-weight: 750;
    transition: transform 0.15s ease, background 0.15s ease;
}

button[type="submit"]:hover {
    background: var(--accent-dark);
}

button[type="submit"]:active {
    transform: translateY(1px);
}

.results {
    scroll-margin-top: 20px;
}

.hidden {
    display: none;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.result-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fbfcfb;
}

.result-item.highlight {
    background: var(--soft);
    border-color: #cbdccd;
}

.result-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.result-item strong {
    display: block;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
}

.result-item small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.75rem;
}

.warning {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--warning-border);
    border-radius: 12px;
    background: var(--warning);
    font-size: 0.9rem;
}

.note {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.note h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.note p {
    margin: 6px 0;
    color: var(--muted);
    font-size: 0.83rem;
}

footer {
    padding: 22px 4px 0;
    color: var(--muted);
    font-size: 0.76rem;
    text-align: center;
}

@media (width >= 600px) {
    .container {
        padding-top: 40px;
    }

    .card {
        padding: 30px;
    }

    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    button[type="submit"] {
        width: auto;
        min-width: 230px;
    }
}

@media (width >= 800px) {
    .container {
        width: min(100% - 48px, 820px);
    }

    .hero {
        padding-bottom: 34px;
    }

    .card {
        padding: 34px;
    }
}

/* Plain-English explanations for financial terminology */
.result-explanation {
    margin: 0.65rem 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #5f6b65;
}


/* Clear buttons inside money inputs */
.input-wrapper {
    position: relative;
}

.input-wrapper .clear-input {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6b64;
    font-size: 20px;
    line-height: 28px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-wrapper .clear-input:hover {
    background: rgba(47, 91, 69, 0.10);
    color: #234b39;
}

.input-wrapper .clear-input:focus-visible {
    outline: 2px solid #2f5b45;
    outline-offset: 2px;
}

.input-wrapper input {
    padding-right: 48px;
}


/* Hide the browser's built-in number spinner arrows.
   The fields still behave as numeric inputs. */

.input-wrapper input[type="number"]::-webkit-inner-spin-button,
.input-wrapper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-wrapper input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}


/* Custom Buyer Type dropdown */

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-button {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 48px 10px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.custom-select-button:hover {
    border-color: #c8d2c9;
}

.custom-select-button:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 92, 69, 0.12);
}

.custom-select-arrow {
    position: absolute;
    right: 17px;
    top: 50%;
    width: 12px;
    height: 8px;
    transform: translateY(-50%);
    pointer-events: none;
}

.custom-select-arrow::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    border-right: 1.8px solid var(--text);
    border-bottom: 1.8px solid var(--text);
    transform: rotate(45deg);
}

.custom-select-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(20, 35, 25, 0.12);
    display: none;
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-select-options button {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.custom-select-options button:hover {
    background: var(--soft);
}

.custom-select-options button[aria-selected="true"] {
    background: var(--soft);
    color: var(--accent-dark);
    font-weight: 700;
}

/* VOKAI DESKTOP WORKSPACE */

@media (min-width: 720px) {
    .container {
        width: min(100% - 80px, 1200px);
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    /* Align hero content with the inner content of the form card */
    .hero {
        width: min(100%, 960px);
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    /* Keep the original hero proportions */
    .hero h1 {
        max-width: 650px;
    }

    .hero .intro {
        max-width: 620px;
    }

    /* Keep the original single-column form design */
    #plannerForm > .card,
    #results.card {
        width: min(100%, 960px);
        margin-left: auto;
        margin-right: auto;
    }
}

