/* ============================================
   QUOTE BUILDER (quote.html)
   Every class is prefixed .quote- so nothing leaks into the rest of the site.
   ============================================ */

.quote-hero {
    min-height: 0;
    padding: 150px 2rem 60px;
}

.quote-hero .subtitle {
    margin-bottom: 0;
}

.quote-section {
    padding: 50px 0 90px;
    background: var(--off-white);
}

/* Author .btn / display styles would otherwise override the hidden attribute */
.quote-app [hidden] {
    display: none !important;
}

.quote-title {
    font-family: var(--heading-font);
    font-size: 1.6rem;
    color: var(--primary-blue);
    margin-bottom: 1.25rem;
    outline: none;
}

.quote-msg {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    background: var(--pure-white);
}

.quote-msg--error {
    color: #9b1c2c;
    background: #fdecee;
    border: 1px solid #f5c2c9;
}

/* ---------- Step 0: segment chooser ---------- */
.quote-choose {
    text-align: center;
}

.quote-segments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.quote-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.75rem 1.25rem;
    background: var(--pure-white);
    border: 3px solid transparent;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    text-align: center;
    color: var(--text-dark);
    text-decoration: none;
    font: inherit;
    transition: var(--transition-smooth);
}

.quote-segment:hover,
.quote-segment:focus-visible {
    border-color: var(--primary-blue);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    outline: none;
}

.quote-segment-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.quote-segment-name {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-blue);
}

.quote-segment-desc {
    font-size: 0.95rem;
    color: var(--medium-gray);
    line-height: 1.5;
}

.quote-segment-price {
    margin-top: auto;
    padding-top: 0.5rem;
    font-family: var(--heading-font);
    font-weight: 700;
    color: var(--accent-red);
}

.quote-alt {
    color: var(--medium-gray);
}

/* ---------- Form layout ---------- */
.quote-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.quote-head {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.quote-link-btn {
    background: none;
    border: 0;
    padding: 0;
    font-family: var(--heading-font);
    font-weight: 700;
    color: var(--primary-blue);
    cursor: pointer;
    text-decoration: underline;
}

.quote-progress {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    counter-reset: qstep;
}

.quote-progress li {
    counter-increment: qstep;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--light-gray);
    font-family: var(--heading-font);
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.quote-progress li::before {
    content: counter(qstep) ". ";
}

.quote-progress li.is-current {
    background: var(--primary-blue);
    color: var(--pure-white);
}

.quote-progress li.is-done {
    background: #d7e5fa;
    color: var(--primary-blue);
}

.quote-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2rem;
    align-items: start;
}

.quote-steps {
    background: var(--pure-white);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    padding: 2rem;
}

.quote-step {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.quote-step legend {
    padding: 0;
}

.quote-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.25rem;
}

.quote-field {
    display: block;
    margin-bottom: 1.1rem;
    font-family: var(--heading-font);
    font-weight: 700;
    color: var(--text-dark);
}

.quote-field > input,
.quote-field > select,
.quote-field > textarea,
.quote-field > .quote-toggle {
    display: block;
    margin-top: 0.4rem;
}

.quote-field > .quote-toggle {
    display: flex;
}

.quote-label {
    font-family: var(--heading-font);
    font-weight: 700;
}

.quote-optional,
.quote-hint {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.quote-field input:not([type="radio"]):not([type="checkbox"]),
.quote-field select,
.quote-field textarea,
.quote-stepper input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    font-family: var(--body-font);
    font-weight: 400;
    font-size: 1rem;
    background: var(--pure-white);
    color: var(--text-dark);
    transition: var(--transition-smooth);
}

.quote-field input:focus,
.quote-field select:focus,
.quote-field textarea:focus,
.quote-stepper input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.12);
}

.quote-field input:user-invalid,
.quote-field select:user-invalid {
    border-color: var(--accent-red);
}

.quote-subhead {
    font-family: var(--heading-font);
    font-size: 1.15rem;
    color: var(--primary-blue);
    margin: 0.5rem 0 1rem;
}

/* ---------- Packages ---------- */
.quote-packages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.quote-package {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1.1rem 0.75rem;
    border: 3px solid var(--light-gray);
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
}

.quote-package input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quote-package:has(input:checked) {
    border-color: var(--primary-blue);
    background: #f2f7ff;
}

.quote-package:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.3);
}

.quote-package-name {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary-blue);
}

.quote-package-hours {
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.quote-package-price {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--accent-red);
}

.quote-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-family: var(--body-font);
    font-weight: 400;
}

.quote-toggle input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary-blue);
}

.quote-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.quote-checks {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.quote-check {
    display: block;
    cursor: pointer;
    line-height: 1.5;
}

.quote-check > * {
    margin-right: 0.35rem;
}

.quote-check input {
    width: 1.15rem;
    height: 1.15rem;
    vertical-align: -0.15rem;
    margin-right: 0.5rem;
    accent-color: var(--primary-blue);
}

.quote-check-price {
    font-family: var(--heading-font);
    font-weight: 700;
    color: var(--accent-red);
}

.quote-check-note {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.quote-check.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------- Rental items ---------- */
.quote-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.quote-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.quote-item-label {
    display: flex;
    flex-direction: column;
    font-family: var(--heading-font);
    font-weight: 700;
}

.quote-item-price {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.quote-stepper {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.quote-stepper input {
    width: 4.5rem;
    text-align: center;
    padding: 0.55rem 0.4rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.quote-step-btn {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: 2px solid var(--primary-blue);
    background: var(--pure-white);
    color: var(--primary-blue);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.quote-step-btn:hover {
    background: var(--primary-blue);
    color: var(--pure-white);
}

/* ---------- Nav ---------- */
.quote-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.quote-nav .btn {
    min-width: 140px;
}

.quote-nav #q-next,
.quote-nav #q-submit {
    margin-left: auto;
}

/* ---------- Live estimate ---------- */
.quote-summary {
    position: sticky;
    top: 110px;
    background: var(--primary-blue);
    color: var(--pure-white);
    border-radius: 18px;
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-hover);
}

.quote-summary h3 {
    font-family: var(--heading-font);
    color: var(--pure-white);
    margin-bottom: 1rem;
}

.quote-lines {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    font-size: 0.95rem;
}

.quote-lines li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.quote-lines li span:last-child {
    white-space: nowrap;
    font-family: var(--heading-font);
    font-weight: 700;
}

.quote-lines .quote-lines-empty {
    display: block;
    opacity: 0.8;
}

.quote-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0;
    font-family: var(--heading-font);
}

.quote-total strong {
    font-size: 2rem;
}

.quote-tax {
    text-align: right;
    font-size: 0.85rem;
    opacity: 0.85;
    margin: 0 0 1rem;
}

.quote-min,
.quote-quoted {
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
}

.quote-quoted p {
    margin: 0 0 0.3rem;
    font-weight: 600;
}

.quote-quoted ul {
    margin: 0;
    padding-left: 1.1rem;
}

.quote-fine {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
    line-height: 1.5;
}

/* ---------- Thank you ---------- */
.quote-done {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    background: var(--pure-white);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    padding: 2.5rem 2rem;
}

.quote-done .btn {
    margin: 0.35rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .quote-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* On small screens the estimate follows the form as a compact card */
    .quote-summary {
        position: static;
        order: 2;
    }

    .quote-segments {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .quote-hero {
        padding: 120px 1rem 40px;
    }

    .quote-section {
        padding: 30px 0 60px;
    }

    .quote-steps {
        padding: 1.25rem;
    }

    .quote-row,
    .quote-packages {
        grid-template-columns: minmax(0, 1fr);
    }

    .quote-package {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 0.85rem 1rem;
    }

    .quote-nav .btn {
        min-width: 0;
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quote-segment,
    .quote-package {
        transition: none;
    }

    .quote-segment:hover {
        transform: none;
    }
}

/* ---------- Phones: sticky running total ---------- */
.quote-bar {
    display: none;
}

@media (max-width: 960px) {
    .quote-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        display: flex;
        align-items: baseline;
        justify-content: center;
        gap: 0.6rem;
        padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom));
        background: var(--primary-blue);
        color: var(--pure-white);
        font-family: var(--heading-font);
        text-decoration: none;
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.15);
    }

    .quote-bar strong {
        font-size: 1.35rem;
    }

    .quote-bar-tax {
        font-size: 0.8rem;
        opacity: 0.85;
    }

    .quote-section {
        padding-bottom: 110px;
    }
}
