/* ==========================================================================
   Shared "Request a Building Evaluation" multi-step modal styles.
   Extracted verbatim from the homepage modal CSS (home.css, "block 3 of 3").
   Pairs with assets/js/eval-modal.js, which injects the matching v2 markup
   (steps shown/hidden by #evalStep1..3 inline display, NOT an .active class).
   Requires the page's style.css for CSS custom properties (--accent, --gray).
   ========================================================================== */
        .eval-modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 10000;
            background: rgba(0, 20, 30, 0.85);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.35s ease, visibility 0.35s ease;
            padding: 1rem;
        }
        .eval-modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }
        .eval-modal {
            background: #ffffff;
            border-radius: 12px;
            max-width: 620px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            padding: 2.5rem 2.5rem 2rem;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
            transform: translateY(20px) scale(0.97);
            transition: transform 0.35s ease;
        }
        .eval-modal-overlay.active .eval-modal {
            transform: translateY(0) scale(1);
        }
        .eval-modal-close {
            position: absolute;
            top: 1rem;
            right: 1.25rem;
            background: none;
            border: none;
            font-size: 1.75rem;
            color: #8A8B8D;
            cursor: pointer;
            line-height: 1;
            transition: color 0.2s;
            z-index: 2;
        }
        .eval-modal-close:hover { color: #00475D; }

        /* ==========================================================================
           Progress bar -- now 6px with an animated sheen so users register the
           step change as feedback. Track is a neutral slate; fill uses the brand
           gradient. cubic-bezier ease makes the width jump feel satisfying
           instead of mechanical.
           ========================================================================== */
        .eval-progress {
            position: relative;
            height: 6px;
            background: var(--off-white);
            border-radius: 999px;
            margin-bottom: 0.65rem;
            overflow: hidden;
            box-shadow: inset 0 1px 2px rgba(0, 34, 51, 0.08);
        }
        .eval-progress-bar {
            position: relative;
            height: 100%;
            background: linear-gradient(90deg, #EA7234 0%, #F08A52 60%, #FFB47A 100%);
            border-radius: 999px;
            transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
            box-shadow: 0 0 8px rgba(234, 114, 52, 0.35);
        }
        /* Subtle moving sheen on the fill -- signals "progressing" */
        .eval-progress-bar::after {
            content: '';
            position: absolute;
            top: 0; left: 0;
            height: 100%;
            width: 100%;
            background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.4) 50%,
                rgba(255, 255, 255, 0) 100%
            );
            animation: evalProgressShine 2.4s ease-in-out infinite;
            mix-blend-mode: overlay;
        }
        @keyframes evalProgressShine {
            0%   { transform: translateX(-100%); }
            60%  { transform: translateX(110%); }
            100% { transform: translateX(110%); }
        }
        .eval-steps-label {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.78rem;
            color: var(--gray);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 1.75rem;
        }
        @media (prefers-reduced-motion: reduce) {
            .eval-progress-bar::after { animation: none; display: none; }
            .eval-progress-bar { transition-duration: 0.2s; }
        }

        /* Steps */
        .eval-step h3 {
            color: #00475D;
            font-size: 1.35rem;
            margin-bottom: 0.35rem;
        }
        .eval-step-desc {
            color: #58595B;
            font-size: 0.92rem;
            margin-bottom: 1.75rem;
            line-height: 1.5;
        }

        /* Fields */
        .eval-field {
            margin-bottom: 1.15rem;
        }
        .eval-field label {
            display: block;
            font-size: 0.82rem;
            font-weight: 600;
            color: #003344;
            margin-bottom: 0.4rem;
            letter-spacing: 0.02em;
        }
        .eval-field input,
        .eval-field select,
        .eval-field textarea {
            width: 100%;
            padding: 0.85rem 1rem;
            border: 1.5px solid var(--gray-lighter);
            border-radius: 8px;
            font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
            font-family: 'Inter', sans-serif;
            color: #003344;
            background: var(--off-white);
            /* Explicit per-property transitions -- cheaper than `all` and
               avoids animating layout-triggering props by accident. */
            transition: border-color 0.3s ease-in-out,
                        box-shadow   0.3s ease-in-out,
                        background   0.3s ease-in-out;
        }
        /* Focus state uses deep navy (engineering palette) instead of orange.
           Reason: orange competes with the primary CTA buttons for attention;
           navy reads as "system is listening to you" without stealing the eye
           from the call-to-action. The layered shadow is an 8px halo over a
           1px inner ring -- reads as "crisp edge + soft glow" at every DPR. */
        .eval-field input:focus,
        .eval-field select:focus,
        .eval-field textarea:focus {
            outline: none;
            border-color: #00475D;
            box-shadow:
                0 0 0 1px #00475D,
                0 0 0 4px rgba(0, 71, 93, 0.14),
                0 4px 12px rgba(0, 71, 93, 0.08);
            background: #ffffff;
        }
        .eval-field input::placeholder,
        .eval-field textarea::placeholder {
            color: #B0B1B3;
        }
        .eval-field textarea {
            resize: vertical;
            min-height: 88px;
        }

        /* ==========================================================================
           Unified <select> styling
           Native iOS Safari renders a tiny gray caret; Android Chrome shows a
           black chevron; desktop browsers each ship their own flavor. Strip
           every native control and paint our own SVG chevron so all platforms
           look identical. The chevron is inlined as a data-URI (no extra
           request) and colored with the navy brand so it matches the focus ring.
           ========================================================================== */
        .eval-field select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            /* Reserve 2.75rem on the right for the chevron so long option
               labels never run underneath it */
            padding-right: 2.75rem;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300475D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 8 10 13 15 8'/></svg>");
            background-repeat: no-repeat;
            background-position: right 1rem center;
            background-size: 16px 16px;
            cursor: pointer;
        }
        /* Chevron subtly lifts + darkens on focus as an additional cue */
        .eval-field select:focus {
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23002F3D' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 8 10 13 15 8'/></svg>");
        }
        /* Kill the dotted focus outline Firefox adds on select */
        .eval-field select::-ms-expand { display: none; }
        .eval-field select:-moz-focusring {
            color: transparent;
            text-shadow: 0 0 0 #003344;
        }
        .eval-field-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        /* Service Selection Cards */
        .eval-service-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
            margin-bottom: 0.5rem;
        }
        .eval-service-card {
            cursor: pointer;
        }
        .eval-service-card input[type="radio"] {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }
        .eval-service-inner {
            border: 1.5px solid var(--gray-lighter);
            border-radius: 10px;
            padding: 1rem;
            text-align: center;
            transition: border-color 0.3s ease-in-out,
                        background   0.3s ease-in-out,
                        box-shadow   0.3s ease-in-out,
                        transform    0.2s ease-in-out;
            background: var(--off-white);
        }
        .eval-service-inner svg {
            display: block;
            margin: 0 auto 0.5rem;
            color: var(--gray);
            transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
        }
        .eval-service-inner span {
            display: block;
            font-size: 0.92rem;
            font-weight: 700;
            color: #003344;
            margin-bottom: 0.2rem;
        }
        .eval-service-inner small {
            display: block;
            font-size: 0.76rem;
            color: var(--gray);
            line-height: 1.35;
        }
        /* Selected state uses deep navy (engineering palette) -- signals
           "confirmed choice" without competing with the primary CTA for eye. */
        .eval-service-card input:checked + .eval-service-inner {
            border-color: #00475D;
            background: rgba(0, 71, 93, 0.05);
            box-shadow:
                0 0 0 1px #00475D,
                0 0 0 4px rgba(0, 71, 93, 0.12);
            transform: translateY(-1px);
        }
        .eval-service-card input:checked + .eval-service-inner svg {
            color: #00475D;
            transform: scale(1.08);
        }
        .eval-service-card:hover .eval-service-inner {
            border-color: #00475D;
            background: rgba(0, 71, 93, 0.02);
        }
        /* Keyboard focus ring for accessibility */
        .eval-service-card input:focus-visible + .eval-service-inner {
            outline: 3px solid rgba(0, 71, 93, 0.35);
            outline-offset: 3px;
        }

        /* ==========================================================================
           Navigation buttons
           Desktop: right-aligned primary CTA, left-aligned secondary (back).
           Mobile: stacked, full-width, 56px minimum touch target (Apple HIG +
           WCAG 2.5.5 Level AAA). The primary CTA is placed FIRST in the DOM
           but LAST on mobile via flex-direction:column-reverse so screen-reader
           users hit "Next" before "Back" while touch users see "Next" on top.
           ========================================================================== */
        .eval-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            margin-top: 1.75rem;
            padding-top: 1.25rem;
            border-top: 1px solid var(--off-white);
        }
        .eval-btn-next,
        .eval-btn-submit {
            background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
            color: #ffffff;
            border: none;
            padding: 0.9rem 1.75rem;
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0.01em;
            border-radius: 8px;
            cursor: pointer;
            box-shadow:
                0 1px 0 rgba(255, 255, 255, 0.15) inset,
                0 4px 12px rgba(234, 114, 52, 0.28);
            transition: background 0.3s ease-in-out,
                        transform 0.2s ease-in-out,
                        box-shadow 0.3s ease-in-out;
            font-family: 'Inter', sans-serif;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            width: auto; /* Desktop default */
        }
        .eval-btn-next:hover,
        .eval-btn-submit:hover {
            background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent-pressed) 100%);
            transform: translateY(-2px);
            box-shadow:
                0 1px 0 rgba(255, 255, 255, 0.15) inset,
                0 8px 20px rgba(234, 114, 52, 0.38);
        }
        .eval-btn-next:active,
        .eval-btn-submit:active {
            transform: translateY(0);
            box-shadow:
                0 1px 0 rgba(255, 255, 255, 0.15) inset,
                0 2px 6px rgba(234, 114, 52, 0.28);
        }
        .eval-btn-next:focus-visible,
        .eval-btn-submit:focus-visible {
            outline: 3px solid rgba(0, 71, 93, 0.35);
            outline-offset: 2px;
        }
        .eval-btn-back {
            background: none;
            border: none;
            color: var(--gray);
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            padding: 0.75rem 0.25rem;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-family: 'Inter', sans-serif;
            transition: color 0.3s ease-in-out;
            min-height: 44px; /* still tappable */
        }
        .eval-btn-back:hover { color: #00475D; }

        /* Success State */
        .eval-success {
            text-align: center;
            padding: 2rem 0;
        }
        .eval-success-icon {
            margin-bottom: 1.5rem;
        }
        .eval-success h3 {
            color: #00475D;
            margin-bottom: 0.75rem;
        }
        .eval-success p {
            color: #58595B;
            font-size: 0.95rem;
            max-width: 420px;
            margin: 0 auto 0.5rem;
            line-height: 1.6;
        }
        .eval-success-phone {
            font-size: 0.88rem !important;
            color: #8A8B8D !important;
            margin-top: 1rem !important;
        }
        .eval-success-phone a {
            color: var(--accent);
            font-weight: 600;
        }

        /* Field validation shake */
        .eval-field-error input,
        .eval-field-error select,
        .eval-field-error textarea {
            border-color: #e53935 !important;
            animation: evalShake 0.4s ease;
        }
        @keyframes evalShake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

        /* ==========================================================================
           Responsive -- mobile-first conversion optimization
           Breakpoint at 768px (standard tablet/phone boundary) so the full
           treatment applies to all phones AND portrait tablets, which fit the
           same "one-handed thumb reach" interaction model.
           ========================================================================== */
        @media (max-width: 768px) {
            .eval-modal {
                padding: 1.75rem 1.25rem 1.5rem;
                max-height: 95vh;
                border-radius: 14px;
            }
            .eval-field-row {
                grid-template-columns: 1fr;
                gap: 0;
            }
            .eval-service-grid {
                grid-template-columns: 1fr;
            }
            .eval-step h3 {
                font-size: 1.2rem;
            }
            /* Stack nav buttons; primary CTA on top (reverse flex order) */
            .eval-nav {
                flex-direction: column-reverse;
                gap: 0.75rem;
                align-items: stretch;
            }
            .eval-btn-next,
            .eval-btn-submit {
                /* Full-width massive touch target -- 56px exceeds Apple HIG
                   (44px) and WCAG 2.5.5 Level AAA (44x44). Thumb-zone tested. */
                width: 100%;
                min-height: 56px;
                padding: 1rem 1.5rem;
                font-size: 1rem;
                border-radius: 10px;
                justify-content: center;
            }
            .eval-btn-back {
                width: 100%;
                min-height: 48px;
                justify-content: center;
            }
        }
        /* Extra squeeze on very small phones */
        @media (max-width: 380px) {
            .eval-modal {
                padding: 1.5rem 1rem 1.25rem;
            }
            .eval-btn-next,
            .eval-btn-submit {
                font-size: 0.95rem;
                min-height: 54px;
            }
        }
