/* Quote builder — loaded only on pages that mount it. */

.qb {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    scroll-margin-top: 6rem;
}

#quote {
    scroll-margin-top: 6.5rem;
}

/* ------------------------------------------------------------- progress bar */

.qb-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.5rem;
    margin: 0;
    padding: 1.1rem clamp(1.25rem, 3vw, 2.25rem);
    list-style: none;
    background: var(--black);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--grey);
}

.qb-progress li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qb-progress span {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.72rem;
}

.qb-progress .is-current {
    color: var(--ink);
    font-weight: 600;
}

.qb-progress .is-current span {
    background: var(--sand);
    border-color: var(--sand);
    color: var(--black);
}

.qb-progress .is-done {
    color: var(--sand-dark);
}

.qb-progress .is-done span {
    background: var(--sand);
    border-color: var(--sand);
    color: var(--black);
}

.qb-progress-now {
    display: none;
}

/* -------------------------------------------------------------------- steps */

.qb-body {
    padding: clamp(1.5rem, 3.5vw, 2.75rem);
}

.qb-step h3 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.qb-lead {
    margin: 0 0 1.75rem;
    color: var(--ink-soft);
    max-width: 60ch;
}

.qb-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.qb-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--grey);
    font-family: var(--font-body);
    font-size: 0.92rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.qb-link:hover {
    color: var(--sand);
}

.qb-aside {
    margin: 1.25rem 0 0;
    text-align: center;
    color: var(--grey);
    font-size: 0.92rem;
}

/* ------------------------------------------------------------ registration */

.qb-reg {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    max-width: 34rem;
}

.qb-reg:focus-within {
    outline: 2px solid var(--sand-dark);
    outline-offset: 3px;
    border-radius: 8px;
}

.qb-reg__field {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    background: #f5d426;
    border: 2px solid var(--black);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    overflow: hidden;
    font-family: var(--font-display);
    color-scheme: light;
}

.qb-reg__flag {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0 0.55rem;
    background: #0b3b92;
    color: var(--white);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.qb-reg__field input {
    width: 100%;
    min-width: 0;
    padding: 0.7rem 0.75rem;
    background: none;
    border: 0;
    color: var(--black);
    font: inherit;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.qb-reg__field input:focus {
    outline: none;
}

.qb .qb-reg__go.btn {
    flex: 0 0 auto;
    align-self: stretch;
    border: 2px solid var(--black);
    border-left: 0;
    border-radius: 0 6px 6px 0;
    padding-inline: 1.15rem;
    white-space: nowrap;
}

.qb .qb-reg__go.btn:hover {
    transform: none;
}

.qb-reg__go-short {
    display: none;
}

.qb-note {
    margin: 0.9rem 0 0;
    padding: 0.7rem 0.9rem;
    background: rgba(196, 176, 152, 0.12);
    border-left: 2px solid var(--sand);
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.qb-note--error {
    background: rgba(192, 86, 58, 0.16);
    border-left-color: #c0563a;
    color: #e08a72;
}

.qb-doors-ask {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: var(--surface, #1c1c1c);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.qb-doors-ask[hidden] {
    display: none !important;
}

.qb-doors-ask p {
    margin: 0 0 0.7rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.qb-doors-ask .qb-checks {
    margin: 0;
}

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

.qb-fields {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.qb-fields:not([hidden]) {
    display: grid;
}

.qb-step[hidden],
.qb-note[hidden],
.qb-error[hidden],
.qb-fields [hidden] {
    display: none !important;
}

.qb-fields--customer {
    margin-top: 2rem;
}

.qb-fields__wide {
    grid-column: 1 / -1;
}

.qb-fields label,
.qb-field__label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
}

.qb-fields label small {
    color: var(--grey);
    font-weight: 400;
    text-transform: none;
}

.qb-field {
    margin-bottom: 1.75rem;
}

.qb-field__label {
    margin-bottom: 0.6rem;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 500;
}

.qb-field__label.is-required::after {
    content: ' *';
    color: var(--sand-dark);
}

.qb-field--missing .qb-field__label {
    color: #8d3a24;
}

.qb-field--missing input,
.qb-field--missing select,
.qb-field--missing textarea,
.qb-field--missing .qb-check,
.qb-field--missing .qb-card,
.qb-field--missing .qb-tint {
    border-color: #c0563a;
}

.qb input[type='text'],
.qb input[type='tel'],
.qb input[type='email'],
.qb input[type='number'],
.qb select,
.qb textarea {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.75rem;
    background: var(--black);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.98rem;
}

.qb .qb-reg__field input[type='text'] {
    width: 100%;
    margin-top: 0;
    padding: 0.7rem 0.75rem;
    background: none;
    border: 0;
    border-radius: 0;
    color: #111;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.qb .qb-reg__field input[type='text']::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.qb textarea {
    resize: vertical;
}

.qb input:focus-visible,
.qb select:focus-visible,
.qb textarea:focus-visible {
    outline: 2px solid var(--sand-dark);
    outline-offset: 1px;
}

.qb-help {
    margin: 0.5rem 0 0;
    color: var(--grey);
    font-size: 0.86rem;
}

.qb-job {
    display: grid;
    gap: 1.15rem;
    margin-top: 2rem;
}

.qb-job .qb-fields__wide,
.qb-job fieldset {
    margin: 0;
}

.qb-job legend,
.qb-job > .qb-fields__wide {
    font-family: var(--font-display);
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
}

.qb-job textarea,
.qb-trailer input {
    margin-top: 0.4rem;
}

.qb-job__condition {
    display: grid;
    gap: 0.65rem;
    padding: 0;
    border: 0;
}

.qb-trailer {
    display: grid;
    gap: 0.5rem;
}

.qb-condition {
    margin: 0.35rem 0 1.25rem;
    color: var(--grey);
    font-size: 0.9rem;
}

.qb-error {
    display: grid;
    gap: 0.35rem;
    margin: 1.5rem 0 0;
    padding: 0.9rem 1rem;
    background: rgba(192, 86, 58, 0.16);
    border-left: 2px solid #c0563a;
    color: #e08a72;
    font-size: 0.92rem;
}

/* Kept out of sight and out of the tab order; only bots fill it in. */
.qb-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --------------------------------------------------------- service picking */

.qb-group + .qb-group {
    margin-top: 2.25rem;
}

.qb-group h4 {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sand-dark);
}

.qb-picks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 0.75rem;
}

.qb-pick {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--off-white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.qb-pick:hover {
    border-color: var(--sand);
}

.qb-pick.is-on {
    background: rgba(196, 176, 152, 0.12);
    border-color: var(--sand);
}

.qb-pick input {
    margin-top: 0.25rem;
    accent-color: var(--sand);
}

.qb-pick__body {
    display: grid;
    gap: 0.25rem;
}

.qb-pick__body strong {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 500;
}

.qb-pick__body span {
    color: var(--grey);
    font-size: 0.88rem;
    line-height: 1.5;
}

.qb-pick__badge {
    justify-self: start;
    margin-top: 0.2rem;
    padding: 0.15rem 0.5rem;
    background: rgba(196, 176, 152, 0.12);
    border-radius: 2px;
    color: var(--sand);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.qb-pick__badge--talk {
    background: var(--sand);
    color: var(--black);
}
}

/* ------------------------------------------------------- per-service panels */

.qb-panel {
    margin-bottom: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.qb-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.15rem;
    background: var(--black);
    border-bottom: 1px solid var(--line);
}

.qb-panel__head h4 {
    margin: 0;
    font-size: 1.08rem;
}

.qb-panel__body {
    padding: 1.4rem 1.15rem 0.35rem;
}

.qb-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.qb-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.6rem 0.7rem;
    background: var(--off-white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.94rem;
    cursor: pointer;
}

.qb-check:hover {
    border-color: var(--sand);
}

.qb-check input {
    margin-top: 0.15rem;
    accent-color: var(--sand);
}

.qb-check--addon {
    display: flex;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    background: var(--black);
    border: 1px dashed var(--sand-dark);
}

.qb-check--addon span {
    display: grid;
    gap: 0.15rem;
}

.qb-check--addon small {
    color: var(--grey);
}

.qb-check--terms {
    margin: 1.5rem 0 0.5rem;
    background: none;
    border: 0;
    padding: 0;
}

.qb-tints {
    display: grid;
    gap: 0.5rem;
}

.qb-tint {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.7rem;
    background: var(--off-white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.94rem;
    cursor: pointer;
}

.qb-tint select {
    width: auto;
    margin: 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.88rem;
}

.qb-tint select:disabled {
    opacity: 0.4;
}

.qb-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.6rem;
}

.qb-card {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    background: var(--off-white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.qb-card.is-on {
    background: rgba(196, 176, 152, 0.12);
    border-color: var(--sand);
}

.qb-card span {
    display: grid;
    gap: 0.2rem;
}

.qb-card strong {
    font-family: var(--font-display);
    font-weight: 500;
}

.qb-card small {
    color: var(--grey);
    font-size: 0.84rem;
    line-height: 1.45;
}

.qb-card input {
    margin-top: 0.25rem;
    accent-color: var(--sand);
}

/* ------------------------------------------------------------------ photos */

.qb-photos {
    display: grid;
    gap: 0.75rem;
}

.qb-photos__add {
    justify-self: start;
    padding: 0.55rem 1rem;
    background: var(--black);
    border-radius: var(--radius);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 0.88rem;
    cursor: pointer;
}

.qb-photos__add input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.qb-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qb-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.qb-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qb-thumb.is-loading {
    opacity: 0.5;
}

.qb-thumb.is-failed em {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0.25rem;
    background: rgba(192, 86, 58, 0.9);
    color: var(--white);
    font-size: 0.68rem;
    font-style: normal;
    text-align: center;
}

.qb-thumb button {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(11, 11, 11, 0.75);
    border: 0;
    border-radius: 50%;
    color: var(--white);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}

/* --------------------------------------------------------- dates and times */

.qb-routes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.qb-card--route {
    padding: 1.1rem 1.25rem;
}

.qb-dates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.qb-date,
.qb-time {
    padding: 0.65rem 0.75rem;
    background: var(--off-white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: var(--font-body);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s var(--ease);
}

.qb-date strong {
    display: block;
    font-family: var(--font-display);
    font-weight: 500;
}

.qb-date small {
    color: var(--grey);
    font-size: 0.8rem;
}

.qb-date:hover,
.qb-time:hover {
    border-color: var(--sand);
}

.qb-date.is-on,
.qb-time.is-on {
    background: var(--black);
    border-color: var(--black);
    color: var(--white);
}

.qb-date.is-on small {
    color: var(--sand-light);
}

.qb-times {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.qb-time {
    text-align: center;
}

.qb-terms {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.qb-terms summary {
    color: var(--grey);
    cursor: pointer;
}

.qb-terms p {
    margin: 0.6rem 0 0;
    color: var(--ink-soft);
}

/* -------------------------------------------------- the summary (server-rendered) */

.qb-vehicle {
    display: grid;
    gap: 0.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.qb-vehicle strong {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
}

.qb-vehicle span {
    color: var(--grey);
    font-size: 0.9rem;
}

.qb-item {
    margin-bottom: 1.75rem;
}

.qb-item h4 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
    font-size: 1.05rem;
}

.qb-item h4 span {
    padding: 0.1rem 0.45rem;
    background: rgba(196, 176, 152, 0.12);
    border-radius: 2px;
    color: var(--sand);
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qb-item__flag {
    margin: 0 0 0.6rem;
    color: var(--sand-dark);
    font-size: 0.86rem;
}

.qb-lines {
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
}

.qb-lines li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px dotted var(--line);
    font-size: 0.95rem;
}

.qb-lines b {
    font-family: var(--font-display);
    font-weight: 500;
    white-space: nowrap;
}

.qb-lines em {
    color: var(--grey);
    font-size: 0.84rem;
    font-style: normal;
    white-space: nowrap;
}

.qb-answers {
    display: grid;
    grid-template-columns: minmax(140px, auto) 1fr;
    gap: 0.25rem 1rem;
    margin: 0;
    font-size: 0.88rem;
}

.qb-answers dt {
    color: var(--grey);
}

.qb-answers dd {
    margin: 0;
    color: var(--ink-soft);
}

.qb-totals {
    margin-top: 1.75rem;
    padding: 1.25rem clamp(1rem, 2.5vw, 1.5rem);
    background: rgba(196, 176, 152, 0.1);
    border-radius: var(--radius);
}

.qb-totals__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.qb-totals__row--sum {
    margin-top: 0.4rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--sand);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
}

.qb-totals__row--time {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--sand);
    color: var(--ink-soft);
}

.qb-totals__note {
    margin: 0.75rem 0 0;
    color: var(--ink-soft);
    font-size: 0.86rem;
}

.qb-reasons {
    margin: 1rem 0 0;
    padding-left: 1.1rem;
    color: var(--grey);
    font-size: 0.88rem;
}

/* ------------------------------------------------------------ confirmation */

.qb-done h3 {
    margin-bottom: 0.5rem;
}

.qb-ref {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.35rem 0.75rem;
    background: var(--black);
    border-radius: 2px;
    color: var(--sand-light);
    font-family: var(--font-display);
    letter-spacing: 0.08em;
}

.qb-done__summary {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
    #quote {
        scroll-margin-top: 7.5rem;
    }

    .qb {
        scroll-margin-top: 5.5rem;
    }

    .qb-progress {
        justify-content: space-between;
        gap: 0.35rem;
        padding: 0.85rem 1rem 0.45rem;
        font-size: 0;
    }

    .qb-progress li {
        flex: 1;
        justify-content: center;
        min-width: 0;
        gap: 0;
    }

    .qb-progress span {
        font-size: 0.72rem;
    }

    .qb-progress-now {
        display: block;
        margin: 0;
        padding: 0 1rem 0.85rem;
        background: var(--black);
        border-bottom: 1px solid var(--line);
        font-family: var(--font-display);
        font-size: 0.92rem;
        font-weight: 500;
        letter-spacing: 0.01em;
        color: var(--ink);
    }

    .qb-reg {
        max-width: none;
    }

    .qb-reg__go-full {
        display: none;
    }

    .qb-reg__go-short {
        display: inline;
    }

    .qb .qb-reg__go.btn {
        padding-inline: 0.9rem;
        min-width: 4.6rem;
    }

    .qb-reg__field input {
        font-size: 1.25rem;
        padding: 0.65rem 0.6rem;
    }

    .qb-link {
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
    }

    .qb-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .qb-actions .btn {
        width: 100%;
    }

    .qb-answers {
        grid-template-columns: 1fr;
        gap: 0 0;
    }

    .qb-answers dd {
        margin-bottom: 0.4rem;
    }
}
