/* forms.css — Quote + Contractor form pages
   Loads after: tokens.css → layout.css → animations.css → components.css
   Scope: templates/page-quote.php + templates/page-contractors.php (enqueued conditionally)
   Reuses global: .container, .section-overline, .section-title, .pb-reveal,
                  .btn-primary, .btn-secondary, .sr-only
   ─────────────────────────────────────────────────────────────────────── */


/* ══════════════════════════════════════════════════════════
   HERO STRIPS — QUOTE + CONTRACTOR
   ══════════════════════════════════════════════════════════ */

.quote-hero,
.contractor-hero {
    background: var(--pb-navy);
    padding: var(--pb-space-16) 0 var(--pb-space-12);
}

@media (min-width: 1024px) {
    .quote-hero,
    .contractor-hero {
        padding: var(--pb-space-24) 0 var(--pb-space-16);
    }
}

.quote-hero .section-overline,
.contractor-hero .section-overline {
    color: rgba(255, 255, 255, 0.65);
    display: block;
    margin-bottom: var(--pb-space-3);
}

.quote-hero__title,
.contractor-hero__title {
    font-family: var(--pb-font-display);
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: var(--pb-leading-tight);
    color: var(--pb-white);
    max-width: 18ch;
    margin: 0 0 var(--pb-space-4);
}

.quote-hero__sub,
.contractor-hero__sub {
    font-family: var(--pb-font-body);
    font-size: var(--pb-text-lg);
    color: rgba(255, 255, 255, 0.75);
    line-height: var(--pb-leading-normal);
    max-width: 58ch;
    margin: 0;
}


/* ══════════════════════════════════════════════════════════
   QUOTE PAGE — BODY LAYOUT
   ══════════════════════════════════════════════════════════ */

.quote-body {
    background: var(--pb-gray-50);
    padding: var(--pb-space-12) 0 var(--pb-space-16);
}

@media (min-width: 1024px) {
    .quote-body {
        padding: var(--pb-space-16) 0 var(--pb-space-24);
    }
}

.quote-layout {
    display: grid;
    gap: var(--pb-space-12);
}

@media (min-width: 1024px) {
    .quote-layout {
        grid-template-columns: 7fr 5fr;
        align-items: start;
        gap: var(--pb-space-16);
    }
}

.quote-layout__form {
    background: var(--pb-white);
    border-radius: var(--pb-radius-xl);
    padding: var(--pb-space-8);
    box-shadow: var(--pb-shadow-md);
}

@media (min-width: 768px) {
    .quote-layout__form {
        padding: var(--pb-space-12);
    }
}


/* ══════════════════════════════════════════════════════════
   QUOTE SIDEBAR
   ══════════════════════════════════════════════════════════ */

.quote-sidebar {
    background: var(--pb-white);
    border-radius: var(--pb-radius-xl);
    padding: var(--pb-space-8);
    box-shadow: var(--pb-shadow-md);
    position: sticky;
    top: calc(var(--pb-space-8) + 80px);
}

@media (min-width: 768px) {
    .quote-sidebar {
        padding: var(--pb-space-8) var(--pb-space-8) var(--pb-space-8);
    }
}

.quote-sidebar__heading {
    font-family: var(--pb-font-display);
    font-weight: 700;
    font-size: var(--pb-text-xl);
    color: var(--pb-navy);
    margin: 0 0 var(--pb-space-6);
    border-bottom: 2px solid var(--pb-gray-200);
    padding-bottom: var(--pb-space-4);
}

.quote-reassurance {
    list-style: none;
    margin: 0 0 var(--pb-space-8);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--pb-space-6);
}

.quote-reassurance__item {
    display: flex;
    gap: var(--pb-space-4);
    align-items: flex-start;
}

.quote-reassurance__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pb-blue-lt);
    border-radius: var(--pb-radius-md);
    color: var(--pb-blue-dark);
}

.quote-reassurance__icon svg {
    width: 20px;
    height: 20px;
}

.quote-reassurance__item strong {
    display: block;
    font-weight: var(--pb-weight-semibold);
    color: var(--pb-gray-900);
    font-size: var(--pb-text-base);
    margin-bottom: var(--pb-space-1);
}

.quote-reassurance__item p {
    margin: 0;
    font-size: var(--pb-text-sm);
    color: var(--pb-gray-700);
    line-height: var(--pb-leading-normal);
}

.quote-sidebar__contact {
    border-top: 1px solid var(--pb-gray-200);
    padding-top: var(--pb-space-6);
}

.quote-sidebar__contact-label {
    font-size: var(--pb-text-sm);
    font-weight: var(--pb-weight-semibold);
    color: var(--pb-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--pb-space-3);
}

.quote-sidebar__contact-link {
    display: flex;
    align-items: center;
    gap: var(--pb-space-2);
    color: var(--pb-blue-dark);
    font-size: var(--pb-text-sm);
    font-weight: var(--pb-weight-medium);
    text-decoration: none;
    padding: var(--pb-space-2) 0;
    min-height: 44px;
    transition: color var(--pb-transition-fast);
}

.quote-sidebar__contact-link:hover {
    color: var(--pb-navy);
}

.quote-sidebar__contact-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--pb-blue-dark);
}


/* ══════════════════════════════════════════════════════════
   CONTRACTOR PAGE — INTRO BENEFITS
   ══════════════════════════════════════════════════════════ */

.contractor-intro {
    background: var(--pb-gray-100);
    padding: var(--pb-space-12) 0;
}

.contractor-benefits {
    display: grid;
    gap: var(--pb-space-6);
}

@media (min-width: 768px) {
    .contractor-benefits {
        grid-template-columns: repeat(3, 1fr);
    }
}

.contractor-benefit {
    background: var(--pb-white);
    border-radius: var(--pb-radius-lg);
    padding: var(--pb-space-6);
}

.contractor-benefit__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--pb-blue-lt);
    border-radius: var(--pb-radius-md);
    color: var(--pb-blue-dark);
    margin-bottom: var(--pb-space-4);
}

.contractor-benefit__icon svg {
    width: 24px;
    height: 24px;
}

.contractor-benefit__title {
    font-family: var(--pb-font-display);
    font-weight: 700;
    font-size: var(--pb-text-lg);
    color: var(--pb-navy);
    margin: 0 0 var(--pb-space-2);
}

.contractor-benefit p {
    margin: 0;
    font-size: var(--pb-text-sm);
    color: var(--pb-gray-700);
    line-height: var(--pb-leading-normal);
}


/* ══════════════════════════════════════════════════════════
   CONTRACTOR FORM SECTION
   ══════════════════════════════════════════════════════════ */

.contractor-form-section {
    background: var(--pb-gray-50);
    padding: var(--pb-space-12) 0 var(--pb-space-16);
}

@media (min-width: 1024px) {
    .contractor-form-section {
        padding: var(--pb-space-16) 0 var(--pb-space-24);
    }
}

.contractor-form-wrap {
    max-width: 760px;
    margin: 0 auto;
    background: var(--pb-white);
    border-radius: var(--pb-radius-xl);
    padding: var(--pb-space-8);
    box-shadow: var(--pb-shadow-md);
}

@media (min-width: 768px) {
    .contractor-form-wrap {
        padding: var(--pb-space-12);
    }
}


/* ══════════════════════════════════════════════════════════
   6-STEP PROGRESS INDICATOR
   ══════════════════════════════════════════════════════════ */

.pb-stepper {
    margin-bottom: var(--pb-space-10);
}

/* ── Desktop stepper ── */
.pb-stepper__desktop {
    display: none;
}

@media (min-width: 768px) {
    .pb-stepper__desktop {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        position: relative;
        padding-top: var(--pb-space-1);
    }
}

.pb-stepper__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.pb-stepper__circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pb-font-display);
    font-size: var(--pb-text-xs);
    font-weight: 700;
    position: relative;
    z-index: 2;
    background: var(--pb-gray-200);
    color: var(--pb-gray-700);
    border: 2px solid var(--pb-gray-300);
    transition: background var(--pb-transition-base), border-color var(--pb-transition-base), color var(--pb-transition-base);
}

/* Active step */
.pb-stepper__step[data-state="active"] .pb-stepper__circle {
    background: var(--pb-navy);
    color: var(--pb-white);
    border-color: var(--pb-navy);
}

/* Complete step */
.pb-stepper__step[data-state="complete"] .pb-stepper__circle {
    background: var(--pb-success);
    color: var(--pb-white);
    border-color: var(--pb-success);
}

.pb-stepper__num {
    display: block;
}

.pb-stepper__check {
    display: none;
    width: 14px;
    height: 14px;
}

.pb-stepper__step[data-state="complete"] .pb-stepper__num {
    display: none;
}

.pb-stepper__step[data-state="complete"] .pb-stepper__check {
    display: block;
}

/* Connecting line between circles */
.pb-stepper__line {
    position: absolute;
    top: 15px;
    inset-inline-start: 50%;
    width: 100%;
    height: 2px;
    background: var(--pb-gray-200);
    z-index: 1;
    transition: background var(--pb-transition-base);
}

.pb-stepper__step[data-state="complete"] .pb-stepper__line {
    background: var(--pb-success);
}

.pb-stepper__label {
    font-size: var(--pb-text-xs);
    color: var(--pb-gray-700);
    margin-top: var(--pb-space-2);
    text-align: center;
    font-weight: var(--pb-weight-medium);
    line-height: 1.2;
    max-width: 80px;
}

.pb-stepper__step[data-state="active"] .pb-stepper__label {
    color: var(--pb-gray-900);
    font-weight: var(--pb-weight-semibold);
}

/* ── Mobile stepper ── */
.pb-stepper__mobile {
    display: flex;
    flex-direction: column;
    gap: var(--pb-space-2);
}

@media (min-width: 768px) {
    .pb-stepper__mobile {
        display: none;
    }
}

.pb-stepper__mobile-text {
    font-size: var(--pb-text-sm);
    font-weight: var(--pb-weight-semibold);
    color: var(--pb-gray-900);
}

.pb-stepper__bar {
    height: 4px;
    background: var(--pb-gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.pb-stepper__bar-fill {
    height: 100%;
    background: var(--pb-navy);
    border-radius: 2px;
    transition: width var(--pb-transition-slow);
}

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


/* ══════════════════════════════════════════════════════════
   CORE FORM PRIMITIVES
   ══════════════════════════════════════════════════════════ */

.pb-form__required-note {
    font-size: var(--pb-text-sm);
    color: var(--pb-gray-700);
    margin: 0 0 var(--pb-space-6);
}

.req-mark {
    color: var(--pb-error);
    font-weight: var(--pb-weight-bold);
    margin-inline-start: 2px;
}

.pb-form__row {
    display: grid;
    gap: var(--pb-space-4);
    margin-bottom: var(--pb-space-6);
}

@media (min-width: 640px) {
    .pb-form__row--2col {
        grid-template-columns: 1fr 1fr;
    }
}

.pb-form__group {
    display: flex;
    flex-direction: column;
    gap: var(--pb-space-2);
    margin-bottom: var(--pb-space-6);
}

/* Groups inside a row take spacing from the row */
.pb-form__row .pb-form__group {
    margin-bottom: 0;
}

.pb-form__label {
    font-family: var(--pb-font-body);
    font-size: var(--pb-text-sm);
    font-weight: var(--pb-weight-semibold);
    color: var(--pb-gray-900);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--pb-space-1);
    cursor: pointer;
}

.pb-form__label-hint {
    font-weight: var(--pb-weight-regular);
    color: var(--pb-gray-700);
    font-size: var(--pb-text-xs);
    display: block;
    width: 100%;
}

.pb-form__label--upload {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

/* ── Inputs ── */
.pb-form__input,
.pb-form__select,
.pb-form__textarea {
    font-family: var(--pb-font-body);
    font-size: var(--pb-text-base);
    color: var(--pb-gray-900);
    background: var(--pb-white);
    border: 1.5px solid var(--pb-gray-300);
    border-radius: var(--pb-radius-md);
    padding: 0 var(--pb-space-4);
    height: 48px;
    width: 100%;
    min-height: 48px;
    transition: border-color var(--pb-transition-fast), box-shadow var(--pb-transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.pb-form__input::placeholder,
.pb-form__textarea::placeholder {
    color: var(--pb-gray-500);
}

.pb-form__input:hover,
.pb-form__select:hover,
.pb-form__textarea:hover {
    border-color: var(--pb-gray-500);
}

.pb-form__input:focus,
.pb-form__select:focus,
.pb-form__textarea:focus {
    outline: none;
    border-color: var(--pb-blue-dark);
    box-shadow: 0 0 0 3px rgba(15, 111, 179, 0.18);
}

.pb-form__textarea {
    height: auto;
    padding: var(--pb-space-3) var(--pb-space-4);
    resize: vertical;
    min-height: 120px;
    line-height: var(--pb-leading-normal);
}

/* Custom select arrow */
.pb-form__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--pb-space-3) center;
    padding-inline-end: var(--pb-space-10);
    cursor: pointer;
}

[dir="rtl"] .pb-form__select {
    background-position: left var(--pb-space-3) center;
    padding-inline-end: var(--pb-space-4);
    padding-inline-start: var(--pb-space-10);
}

/* ── Error state ── */
.pb-form__group--error .pb-form__input,
.pb-form__group--error .pb-form__select,
.pb-form__group--error .pb-form__textarea {
    border-color: var(--pb-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ── Success state ── */
.pb-form__group--success .pb-form__input,
.pb-form__group--success .pb-form__select {
    border-color: var(--pb-success);
}

.pb-form__group--success .pb-form__input:focus,
.pb-form__group--success .pb-form__select:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ── Inline error messages ── */
.field-error {
    display: flex;
    align-items: flex-start;
    gap: var(--pb-space-1);
    font-size: var(--pb-text-sm);
    color: var(--pb-gray-900);
    line-height: var(--pb-leading-snug);
    margin-top: var(--pb-space-1);
}

.field-error__icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    color: var(--pb-error);
}

/* ── Success icon on valid fields ── */
.field-success-icon {
    position: absolute;
    inset-inline-end: var(--pb-space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--pb-success);
    pointer-events: none;
}

.pb-form__group {
    position: relative;
}


/* ══════════════════════════════════════════════════════════
   FORM ERROR SUMMARY BANNER
   ══════════════════════════════════════════════════════════ */

.form-error-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--pb-space-3);
    background: rgba(239, 68, 68, 0.07);
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--pb-radius-md);
    padding: var(--pb-space-4) var(--pb-space-5);
    margin-bottom: var(--pb-space-6);
    color: var(--pb-gray-900);
    font-size: var(--pb-text-sm);
    line-height: var(--pb-leading-normal);
}

.form-error-banner p {
    margin: 0;
}

.form-error-banner__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--pb-error);
    margin-top: 1px;
}

.form-error-summary {
    background: rgba(239, 68, 68, 0.06);
    border: 1.5px solid rgba(239, 68, 68, 0.28);
    border-radius: var(--pb-radius-md);
    padding: var(--pb-space-4) var(--pb-space-5);
    margin-bottom: var(--pb-space-6);
    font-size: var(--pb-text-sm);
}

.form-error-summary p {
    margin: 0 0 var(--pb-space-2);
    font-weight: var(--pb-weight-semibold);
    color: var(--pb-gray-900);
}

.form-error-summary ul {
    margin: 0;
    padding-inline-start: var(--pb-space-4);
}

.form-error-summary a {
    color: var(--pb-blue-dark);
    text-decoration: underline;
}

.form-error-summary a:hover {
    color: var(--pb-navy);
}


/* ══════════════════════════════════════════════════════════
   FILE UPLOAD ZONES
   ══════════════════════════════════════════════════════════ */

.pb-upload-zone {
    position: relative;
    border-radius: var(--pb-radius-lg);
    overflow: hidden;
}

.pb-upload-zone__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--pb-space-8) var(--pb-space-6);
    border: 2px dashed var(--pb-gray-300);
    border-radius: var(--pb-radius-lg);
    background: var(--pb-gray-50);
    cursor: pointer;
    transition: border-color var(--pb-transition-fast), background var(--pb-transition-fast);
    min-height: 120px;
    gap: var(--pb-space-2);
}

.pb-upload-zone__inner:hover {
    border-color: var(--pb-blue);
    background: var(--pb-blue-lt);
}

.pb-upload-zone__inner:focus-within {
    border-color: var(--pb-blue-dark);
    box-shadow: 0 0 0 3px rgba(15, 111, 179, 0.18);
}

/* Drag-over state — added by JS */
.pb-upload-zone.is-dragover .pb-upload-zone__inner {
    border-color: var(--pb-blue);
    background: var(--pb-blue-lt);
}

.pb-upload-zone__icon {
    width: 32px;
    height: 32px;
    color: var(--pb-gray-500);
    transition: color var(--pb-transition-fast);
}

.pb-upload-zone__inner:hover .pb-upload-zone__icon,
.pb-upload-zone.is-dragover .pb-upload-zone__icon {
    color: var(--pb-blue-dark);
}

.pb-upload-zone__text {
    font-size: var(--pb-text-sm);
    font-weight: var(--pb-weight-medium);
    color: var(--pb-gray-900);
}

.pb-upload-zone__formats {
    font-size: var(--pb-text-xs);
    color: var(--pb-gray-700);
}

/* Compact variant — used for the 4 document upload zones */
.pb-upload-zone--compact .pb-upload-zone__inner {
    flex-direction: row;
    padding: var(--pb-space-4) var(--pb-space-5);
    min-height: 64px;
    justify-content: flex-start;
    gap: var(--pb-space-3);
    text-align: start;
}

.pb-upload-zone__icon--sm {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* File preview row (shown after file is chosen) */
.pb-upload-zone__preview {
    display: flex;
    align-items: center;
    gap: var(--pb-space-3);
    padding: var(--pb-space-3) var(--pb-space-4);
    background: var(--pb-gray-100);
    border: 1.5px solid var(--pb-gray-200);
    border-radius: var(--pb-radius-md);
    margin-top: var(--pb-space-2);
    font-size: var(--pb-text-sm);
    color: var(--pb-gray-900);
}

.pb-upload-zone__preview[hidden] {
    display: none;
}

.pb-upload-zone__filename {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pb-upload-zone__remove {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--pb-radius-sm);
    color: var(--pb-gray-700);
    cursor: pointer;
    transition: color var(--pb-transition-fast), background var(--pb-transition-fast);
}

.pb-upload-zone__remove:hover {
    color: var(--pb-error);
    background: rgba(239, 68, 68, 0.08);
}

.pb-upload-zone__remove svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}


/* ══════════════════════════════════════════════════════════
   HONEYPOT
   ══════════════════════════════════════════════════════════ */

.pb-hp {
    position: absolute;
    inset-inline-start: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    tab-size: 0;
}


/* ══════════════════════════════════════════════════════════
   MULTI-STEP: STEP FIELDSETS
   ══════════════════════════════════════════════════════════ */

.pb-form__step {
    border: none;
    padding: 0;
    margin: 0;
}

.pb-form__step-legend {
    font-family: var(--pb-font-display);
    font-weight: 700;
    font-size: var(--pb-text-xl);
    color: var(--pb-navy);
    margin-bottom: var(--pb-space-6);
    display: flex;
    align-items: center;
    gap: var(--pb-space-3);
    width: 100%;
    padding: 0;
}

.pb-form__step-num {
    font-family: var(--pb-font-mono);
    font-size: var(--pb-text-xs);
    font-weight: 500;
    color: var(--pb-blue-dark);
    letter-spacing: 0.05em;
    background: var(--pb-blue-lt);
    padding: 2px var(--pb-space-2);
    border-radius: var(--pb-radius-sm);
}

.pb-form__step-hint {
    font-size: var(--pb-text-sm);
    color: var(--pb-gray-700);
    line-height: var(--pb-leading-normal);
    margin: calc(-1 * var(--pb-space-2)) 0 var(--pb-space-6);
}

/* JS hides inactive steps — without JS all are visible */
.js-enhanced .pb-form__step {
    display: none;
}

.js-enhanced .pb-form__step.is-active {
    display: block;
}

/* Step transitions (only when JS is active + motion is OK) */
@media (prefers-reduced-motion: no-preference) {
    .js-enhanced .pb-form__step.is-entering {
        animation: step-enter 200ms ease-out both;
    }

    .js-enhanced .pb-form__step.is-leaving {
        animation: step-leave 150ms ease-out both;
    }

    .js-enhanced .pb-form__step.is-entering-back {
        animation: step-enter-back 200ms ease-out both;
    }

    @keyframes step-enter {
        from { opacity: 0; transform: translateX(20px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    @keyframes step-leave {
        from { opacity: 1; transform: translateX(0); }
        to   { opacity: 0; transform: translateX(-20px); }
    }

    @keyframes step-enter-back {
        from { opacity: 0; transform: translateX(-20px); }
        to   { opacity: 1; transform: translateX(0); }
    }
}


/* ══════════════════════════════════════════════════════════
   STEP NAVIGATION (BACK + NEXT/SUBMIT)
   ══════════════════════════════════════════════════════════ */

.pb-form__step-nav {
    display: flex;
    gap: var(--pb-space-4);
    margin-top: var(--pb-space-8);
    padding-top: var(--pb-space-6);
    border-top: 1px solid var(--pb-gray-200);
    flex-wrap: wrap;
}

.pb-form__step-nav .btn {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    gap: var(--pb-space-2);
}

.pb-form__step-nav .pb-form__next {
    margin-inline-start: auto;
}

.pb-form__step-nav .pb-form__back {
    flex-shrink: 0;
}

@media (max-width: 639px) {
    .pb-form__step-nav {
        flex-direction: column-reverse;
    }

    .pb-form__step-nav .btn {
        width: 100%;
        justify-content: center;
    }

    .pb-form__step-nav .pb-form__next {
        margin-inline-start: 0;
    }
}

.btn-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-arrow--left {
    order: -1;
}

/* Submit / main form action */
.pb-form__actions {
    margin-top: var(--pb-space-8);
}

.pb-form__submit {
    width: 100%;
    min-height: 56px;
    font-size: var(--pb-text-base);
    font-weight: var(--pb-weight-bold);
    letter-spacing: 0.02em;
}

.pb-form__submit[aria-busy="true"] {
    opacity: 0.7;
    cursor: not-allowed;
}


/* ══════════════════════════════════════════════════════════
   CHECKBOX GRID (STEP 3 — CAPABILITIES)
   ══════════════════════════════════════════════════════════ */

.pb-form__checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--pb-space-3);
    margin-bottom: var(--pb-space-2);
}

@media (min-width: 768px) {
    .pb-form__checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 479px) {
    .pb-form__checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.pb-form__checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--pb-space-3);
    cursor: pointer;
    padding: var(--pb-space-3) var(--pb-space-4);
    border: 1.5px solid var(--pb-gray-200);
    border-radius: var(--pb-radius-md);
    background: var(--pb-white);
    min-height: 48px;
    transition: border-color var(--pb-transition-fast), background var(--pb-transition-fast);
    user-select: none;
}

.pb-form__checkbox-item:hover {
    border-color: var(--pb-blue);
    background: var(--pb-blue-lt);
}

/* Checked state */
.pb-form__checkbox-item:has(.pb-form__checkbox:checked) {
    border-color: var(--pb-blue-dark);
    background: var(--pb-blue-lt);
}

.pb-form__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pb-form__checkbox-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: var(--pb-radius-sm);
    border: 2px solid var(--pb-gray-300);
    background: var(--pb-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--pb-transition-fast), background var(--pb-transition-fast);
    pointer-events: none;
}

.pb-form__checkbox:checked ~ .pb-form__checkbox-box {
    border-color: var(--pb-blue-dark);
    background: var(--pb-blue-dark);
}

.pb-form__checkbox:checked ~ .pb-form__checkbox-box::after {
    content: '';
    display: block;
    width: 10px;
    height: 6px;
    border-left: 2px solid var(--pb-white);
    border-bottom: 2px solid var(--pb-white);
    transform: rotate(-45deg) translateY(-1px);
}

.pb-form__checkbox:focus-visible ~ .pb-form__checkbox-box {
    outline: 3px solid rgba(15, 111, 179, 0.4);
    outline-offset: 2px;
}

.pb-form__checkbox-label {
    font-size: var(--pb-text-sm);
    font-weight: var(--pb-weight-medium);
    color: var(--pb-gray-900);
    line-height: var(--pb-leading-snug);
}

/* Consent checkbox — full width, larger area */
.pb-form__checkbox-item--consent {
    border: 1.5px solid var(--pb-gray-200);
    border-radius: var(--pb-radius-md);
    padding: var(--pb-space-4);
    align-items: flex-start;
    min-height: 0;
}

.pb-form__checkbox-item--consent .pb-form__checkbox-label {
    font-size: var(--pb-text-sm);
    color: var(--pb-gray-700);
    line-height: var(--pb-leading-normal);
}

.pb-form__group--consent {
    margin-top: var(--pb-space-6);
}

.pb-form__group--consent .pb-form__checkbox-item--consent:has(.pb-form__checkbox:checked) {
    border-color: var(--pb-success);
    background: rgba(16, 185, 129, 0.05);
}


/* ══════════════════════════════════════════════════════════
   STEP 6 — REVIEW SUMMARY
   ══════════════════════════════════════════════════════════ */

.pb-review {
    background: var(--pb-gray-50);
    border: 1px solid var(--pb-gray-200);
    border-radius: var(--pb-radius-lg);
    padding: var(--pb-space-6);
    margin-bottom: var(--pb-space-6);
}

.pb-review__section {
    margin-bottom: var(--pb-space-6);
}

.pb-review__section:last-child {
    margin-bottom: 0;
}

.pb-review__section-title {
    font-family: var(--pb-font-display);
    font-weight: 600;
    font-size: var(--pb-text-sm);
    color: var(--pb-blue-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 var(--pb-space-3);
    padding-bottom: var(--pb-space-2);
    border-bottom: 1px solid var(--pb-gray-200);
}

.pb-review__row {
    display: flex;
    gap: var(--pb-space-4);
    padding: var(--pb-space-2) 0;
    font-size: var(--pb-text-sm);
    border-bottom: 1px solid var(--pb-gray-100);
}

.pb-review__row:last-child {
    border-bottom: none;
}

.pb-review__key {
    width: 140px;
    flex-shrink: 0;
    color: var(--pb-gray-700);
    font-weight: var(--pb-weight-medium);
}

.pb-review__value {
    flex: 1;
    color: var(--pb-gray-900);
    word-break: break-word;
    overflow-wrap: break-word;
}

.pb-review__empty {
    color: var(--pb-gray-500);
    font-style: italic;
}

.pb-review__nojs-note {
    color: var(--pb-gray-700);
    font-size: var(--pb-text-sm);
    margin: 0;
}


/* ══════════════════════════════════════════════════════════
   SUCCESS STATE
   ══════════════════════════════════════════════════════════ */

.form-success {
    text-align: center;
    padding: var(--pb-space-12) var(--pb-space-8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--pb-space-4);
}

.form-success__icon {
    margin-bottom: var(--pb-space-4);
}

.success-checkmark {
    width: 64px;
    height: 64px;
    display: block;
}

/* Animate the checkmark stroke on entry */
@media (prefers-reduced-motion: no-preference) {
    .success-checkmark__path {
        stroke-dasharray: 40;
        stroke-dashoffset: 40;
        animation: draw-check 400ms ease-out 200ms forwards;
    }

    @keyframes draw-check {
        to { stroke-dashoffset: 0; }
    }
}

.form-success__title {
    font-family: var(--pb-font-display);
    font-weight: 700;
    font-size: var(--pb-text-2xl);
    color: var(--pb-navy);
    margin: 0;
}

.form-success__sub {
    font-size: var(--pb-text-base);
    color: var(--pb-gray-700);
    max-width: 46ch;
    line-height: var(--pb-leading-normal);
    margin: 0;
}

.form-success__wa {
    margin-top: var(--pb-space-4);
    padding-top: var(--pb-space-6);
    border-top: 1px solid var(--pb-gray-200);
    width: 100%;
    max-width: 360px;
}

.form-success__wa-label {
    font-size: var(--pb-text-sm);
    color: var(--pb-gray-700);
    font-weight: var(--pb-weight-medium);
    margin: 0 0 var(--pb-space-3);
}

.btn-whatsapp {
    /* WhatsApp brand colors — external brand, not project palette tokens */
    --wa-green:       #25D366;
    --wa-green-hover: #1ebe5a;

    display: inline-flex;
    align-items: center;
    gap: var(--pb-space-2);
    background: var(--wa-green);
    color: var(--pb-white);
    font-size: var(--pb-text-base);
    font-weight: var(--pb-weight-semibold);
    padding: 0 var(--pb-space-6);
    height: 52px;
    border-radius: var(--pb-radius-full);
    text-decoration: none;
    transition: background var(--pb-transition-fast), transform var(--pb-transition-fast);
    width: 100%;
    justify-content: center;
}

.btn-whatsapp:hover {
    background: var(--wa-green-hover);
}

@media (prefers-reduced-motion: no-preference) {
    .btn-whatsapp:hover {
        transform: translateY(-1px);
    }
}

.btn-whatsapp__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ══════════════════════════════════════════════════════════ */

@media (max-width: 639px) {
    .quote-layout__form,
    .contractor-form-wrap {
        padding: var(--pb-space-6);
        border-radius: var(--pb-radius-lg);
    }

    .form-success {
        padding: var(--pb-space-8) var(--pb-space-4);
    }
}
