/*
 * The cost estimate (estimate.html): four questions, one a screen, then a plain quote. The site's
 * own tokens (assets/styles.css), so it follows the light and the dark theme; amber only for
 * GreenOlive's figures. One centred column, the same height on every screen, so nothing jumps.
 */
.estimate-page h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

.estimate-page h2 {
    font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.est-shell {
    width: min(760px, 100% - 32px);
    margin: 0 auto;
}

.est-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
}

.est-brand {
    display: inline-flex;
    color: var(--fg);
}

.est-brand .wordmark {
    height: 24px;
}

.est-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 8px 0 2px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--fg-muted);
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

.est-back:hover {
    color: var(--fg);
}

.est-progress {
    height: 3px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--border);
}

.est-progress i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--ink);
    transition: width 500ms var(--ease-out);
}

/* (Stronger than the home page's room for its fixed header, which this page has no need of.) */
.estimate-page .est-stage {
    min-height: 520px;
    padding: clamp(36px, 8vh, 80px) 0 48px;
}

/* Each screen slides in from the side it comes from. */
.est-slide {
    display: grid;
    gap: 28px;
}

.est-slide.is-in {
    animation: est-in 400ms var(--ease-out) both;
}

.est-slide.is-back {
    animation: est-back 400ms var(--ease-out) both;
}

@keyframes est-in {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
}

@keyframes est-back {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
}

.est-lead {
    color: var(--fg-muted);
    font-size: 1.1rem;
}

.est-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    gap: 8px;
    min-height: 52px;
    padding: 0 26px;
    border: 1px solid var(--ink);
    border-radius: 12px;
    background: var(--ink);
    color: var(--ink-fg);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 200ms var(--ease-out), box-shadow 200ms ease, opacity 200ms ease;
}

.est-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -10px rgb(0 0 0 / 45%);
}

.est-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.est-button .icon {
    transition: transform 200ms var(--ease-out);
}

.est-button:hover .icon {
    transform: translateX(3px);
}

.est-tile {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--ink-fg);
}

/* How many people: a large number, and a slider for the usual sizes. */
.est-size {
    display: grid;
    gap: 22px;
}

.est-size-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.est-size input[type="number"] {
    width: 4.2ch;
    padding: 0 0 4px;
    border: 0;
    border-bottom: 2px solid var(--border-strong);
    background: transparent;
    color: var(--fg);
    font: 750 clamp(3.4rem, 11vw, 5rem) / 1 var(--font);
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
}

.est-size input[type="number"]:focus {
    outline: 0;
    border-color: var(--fg);
}

.est-size input::-webkit-inner-spin-button,
.est-size input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.est-size-unit {
    color: var(--fg-muted);
    font-size: 1.3rem;
    font-weight: 600;
}

.est-size input[type="range"] {
    width: 100%;
    height: 32px;
    accent-color: var(--ink);
}

/* Two choices, as large cards. */
.est-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.est-choice {
    display: grid;
    align-content: start;
    gap: 14px;
    min-height: 150px;
    padding: 22px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--bg);
    color: var(--fg);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, transform 200ms var(--ease-out);
}

.est-choice:hover {
    border-color: var(--fg);
    transform: translateY(-2px);
}

.est-choice[aria-checked="true"] {
    border-color: var(--ink);
    background: color-mix(in srgb, var(--fg) 5%, transparent);
    box-shadow: inset 0 0 0 1px var(--ink);
}

.est-choice b {
    font-size: 1.15rem;
    line-height: 1.25;
}

.est-choice small {
    color: var(--fg-muted);
    font-size: 0.92rem;
}

/* The tools used today. */
.est-apps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
    gap: 8px;
}

.est-app {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--bg);
    color: var(--fg);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.est-app .est-tile {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--bg-soft);
    color: var(--fg);
    transition: background-color 160ms ease, color 160ms ease;
}

.est-app .est-tile .icon {
    width: 18px;
    height: 18px;
}

.est-app[aria-pressed="true"] {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
}

.est-app[aria-pressed="true"] .est-tile {
    background: var(--ink);
    color: var(--ink-fg);
}

.est-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.est-link {
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--fg-muted);
    font: inherit;
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* The result: a dark panel with the two yearly totals and their bars; the details fold away. */
.est-result {
    display: grid;
    gap: 24px;
    padding: clamp(24px, 5vw, 40px);
    border: 1px solid var(--panel-edge);
    border-radius: 20px;
    background: var(--panel);
    color: var(--panel-fg);
    box-shadow: 0 30px 60px -24px rgb(0 0 0 / 45%);
}

.est-result h2 b {
    color: var(--accent);
    font-weight: inherit;
    white-space: nowrap;
}

.est-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.est-total {
    display: grid;
    gap: 2px;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--panel-raised);
}

.est-total small {
    color: var(--panel-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.est-total strong {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.est-total span {
    color: var(--panel-muted);
    font-size: 0.9rem;
}

.est-total.is-greenolive strong {
    color: var(--accent);
}

.est-bar {
    height: 10px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 99px;
    background: rgb(255 255 255 / 10%);
}

.est-bar i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 99px;
    background: var(--panel-muted);
    transition: width 900ms var(--ease-out);
}

.est-total.is-greenolive .est-bar i {
    background: var(--accent);
}

.est-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.est-cta .est-button {
    border-color: var(--panel-fg);
    background: var(--panel-fg);
    color: var(--panel);
}

.est-cta .est-link {
    color: var(--panel-muted);
}

.est-result details {
    padding-top: 14px;
    border-top: 1px solid rgb(255 255 255 / 12%);
}

.est-result summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    color: var(--panel-muted);
    font-size: 0.95rem;
    list-style: none;
    cursor: pointer;
}

.est-result summary::-webkit-details-marker {
    display: none;
}

.est-result summary .icon {
    width: 18px;
    height: 18px;
    transition: transform 200ms ease;
}

.est-result details[open] summary .icon {
    transform: rotate(180deg);
}

.est-lines {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 12px;
}

.est-lines h3 {
    margin: 0 0 6px;
    font-size: 0.92rem;
}

.est-lines table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.est-lines td {
    padding: 6px 0;
    border-top: 1px solid rgb(255 255 255 / 8%);
    border-bottom: 0;
    color: var(--panel-muted);
    vertical-align: top;
}

.est-lines tr:first-child td {
    border-top: 0;
}

.est-lines td:last-child {
    padding-left: 12px;
    color: var(--panel-fg);
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.est-lines-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: var(--panel-muted);
    font-size: 0.84rem;
}

.est-lines-foot select {
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 8px;
    background: var(--panel-raised);
    color: var(--panel-fg);
    font: inherit;
    font-size: 0.88rem;
}

@media (max-width: 600px) {
    .est-choices,
    .est-totals,
    .est-lines {
        grid-template-columns: minmax(0, 1fr);
    }

    .est-choice {
        min-height: 0;
    }

    .est-slide > .est-button,
    .est-cta .est-button {
        width: 100%;
    }

    .estimate-page .est-stage {
        min-height: 0;
    }
}
