:root {
    /* Brand Colors - Primary */
    --primary-blue: #003366;
    --secondary-blue: #0056b3;
    --light-blue: #e6f0ff;
    
    /* Brand Colors - Text */
    --text-dark: #333333;
    --text-medium: #666666;
    --text-light: #999999;
    
    /* Brand Colors - Background */
    --bg-white: #ffffff;
    --bg-gray: #f0f2f5;
    
    /* Brand Colors - Border */
    --border-gray: #e4e6eb;
    
    /* Brand Colors - Status */
    --status-success: #2f855a;
    --status-success-bg: #f0fff4;
    --status-success-border: #c6f6d5;
    --status-error: #c53030;
    --status-error-bg: #fff5f5;
    --status-error-border: #feb2b2;
    --status-info: #0056b3;
    --status-info-bg: #f0f7ff;
    --status-info-border: #cce3ff;
    
    /* Brand Colors - Accent */
    --accent-dark: #1a202c;
    --accent-highlight: #feb2b2;
    --accent-google: #4285F4;
    --accent-star-yellow: #fbbc04;
    
    /* Brand Shadows */
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-button: 0 4px 15px rgba(0, 51, 102, 0.2);
    --shadow-button-hover: 0 6px 20px rgba(0, 51, 102, 0.3);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-badge: 0 2px 8px rgba(0,0,0,0.15);
    
    /* Brand Transitions */
    --transition-default: all 0.2s ease;
    --transition-slow: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    
    /* Brand Border Radius */
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --radius-xlarge: 16px;
    
    /* Brand Typography - Line Heights */
    --line-height-heading: 1.2;
    --line-height-body: 1.4;
    --line-height-button: 1.1;
    
    /* Brand Typography - Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Brand Spacing */
    --container-max-width: 1440px;
    --section-padding-desktop: 80px;
    --section-padding-mobile: 48px;
    
    /* Legacy variables for compatibility */
    --progress-bg: #e9ecef;
    --progress-fill: #003366;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: var(--line-height-body);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 8px 20px 80px 20px; /* Minimal top padding, extra bottom padding for cookie banner */
    font-size: 16px; /* body desktop size from brand-spec */
}

/* Ensure all elements use the same font */
* {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

.site-footer {
    margin-top: 200px; /* Pushed footer further down */
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    width: 100%;
    max-width: 550px;
}

@media (max-width: 600px) {
    .site-footer {
        margin-top: 40px; /* Much less space on mobile */
    }
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.review-ratings-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin: 20px auto 0;
    padding: 20px 0;
    flex-wrap: wrap;
    width: 100%;
    max-width: 550px;
}

.review-platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 180px;
}

.review-platform-header {
    margin-bottom: 4px;
}

.review-platform-logo-text {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.review-platform-logo-text.trustpilot {
    color: #00b67a;
}

.review-platform-logo-text.google {
    background: linear-gradient(to right, #4285F4 0%, #EA4335 25%, #FBBC04 50%, #4285F4 75%, #34A853 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 500;
}

.review-stars-image {
    height: auto;
    width: auto;
    max-width: 120px;
    display: block;
    margin: 0;
    margin-bottom: 4px;
}

.review-rating-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 0;
}

.review-rating-number {
    font-size: 18px;
    font-weight: 700;
    color: #003366;
}

.review-count-text {
    font-size: 13px;
    color: #666666;
}

@media (max-width: 480px) {
    .review-ratings-section {
        gap: 15px;
        padding: 10px 0;
        margin: 10px auto 0;
    }
    
    .review-platform-item {
        min-width: 120px;
    }
    
    .review-stars-image {
        max-width: 90px;
    }
    
    .review-rating-number {
        font-size: 16px;
    }
    
    .review-count-text {
        font-size: 12px;
    }
}

.review-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.review-platform-logo {
    display: block;
    max-width: 120px;
    height: auto;
    margin-bottom: 1px;
    object-fit: contain;
}

.review-stars {
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
}

.review-star {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
}

.review-star.trustpilot {
    color: #00b67a;
}

.review-star.google {
    color: #fbbc04;
}

.review-star.partial {
    position: relative;
    display: inline-block;
    color: #e0e0e0;
}

.review-star.partial .partial-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 75%;
    overflow: hidden;
    display: inline-block;
}

.review-star.partial.trustpilot .partial-fill {
    color: #00b67a;
}

.review-star.partial.google .partial-fill {
    color: #fbbc04;
}

.review-rating {
    font-size: 18px;
    font-weight: 700;
    color: #003366;
}

.review-count {
    font-size: 13px;
    color: #666666;
    margin-left: 4px;
}

@media (max-width: 480px) {
    .footer-review-ratings {
        gap: 20px;
        padding: 15px 0;
    }
    
    .review-platform {
        min-width: 150px;
    }
    
    .review-star {
        font-size: 18px;
    }
    
    .review-rating {
        font-size: 16px;
    }
}

.copyright {
    opacity: 0.8;
    margin-bottom: 12px;
}

.disclaimer {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-light);
    opacity: 0.7;
    margin-top: 1px;
    padding-top: 1px;
    border-top: 1px solid rgba(0,0,0,0.05);
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
}

.simplified-container {
    width: 100%;
    max-width: 550px; /* Form container - keeping smaller for form UX */
    background: var(--bg-white);
    border-radius: var(--radius-xlarge); /* 16px from brand-spec */
    box-shadow: var(--shadow);
    padding: 20px 20px;
    position: relative;
    overflow: visible;
    transition: var(--transition-slow);
    contain: layout style;
    margin-top: 0;
    box-sizing: border-box;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 16px;
    display: none; /* Hidden by default - JavaScript will show it from step 2 onwards */
}

/* Social Proof Badge */
.social-proof-badge {
    background-color: var(--accent-dark); /* badge.background from brand-spec */
    color: white; /* badge.color from brand-spec */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 20px;
    border-radius: var(--radius-medium); /* badge.borderRadius 8px from brand-spec */
    font-size: 16px; /* badge.fontSize from brand-spec */
    font-weight: var(--font-weight-bold); /* badge.fontWeight 700 from brand-spec */
    margin: 0 auto 20px;
    width: fit-content;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: var(--shadow-badge); /* shadows.badge from brand-spec */
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.social-proof-badge .badge-icon {
    font-size: 14px;
}

#quote-counter {
    color: var(--accent-highlight); /* Slightly highlighted number like the red in reference */
}

.social-proof-badge .plus-sign {
    margin-left: -2px; /* Reduce spacing between number and plus sign */
    color: white;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 4px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background-color: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--progress-fill);
    width: 20%;
    transition: width 0.3s ease;
}

/* Steps */
.step-content {
    position: absolute;
    left: 0;
    right: 0;
    visibility: hidden;
    opacity: 0;
    text-align: center;
    flex-direction: column;
    justify-content: flex-start; /* Align to top, not center */
    will-change: transform, opacity;
    contain: layout style paint;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s 0.4s;
    transform: translateY(10px);
}

.step-content.active {
    position: relative;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s 0s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-size: 36px; /* h2 desktop from brand-spec */
    color: var(--primary-blue);
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: var(--font-weight-extrabold);
    text-transform: uppercase;
    line-height: var(--line-height-heading);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Smaller font size for step 1 heading to fit on one line */
#step-1 h2 {
    font-size: 28px;
}

/* Smaller font size for headings on steps 2, 3, 4, and 6 */
#step-2 h2,
#step-3 h2,
#step-4 h2,
#step-6 h2 {
    font-size: 28px; /* h3 desktop from brand-spec */
}

.subtitle {
    font-size: 14px; /* small from brand-spec */
    color: var(--secondary-blue);
    margin-bottom: 2px;
    font-weight: var(--font-weight-semibold);
    text-align: center;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: var(--line-height-body);
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.subtitle-small {
    font-size: 14px; /* small from brand-spec */
    color: var(--text-medium);
    margin-bottom: 25px;
    line-height: var(--line-height-body);
}

/* Form Elements */
.form-group {
    text-align: left;
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 14px; /* small from brand-spec */
    font-weight: var(--font-weight-semibold);
    margin-bottom: 4px;
    color: var(--text-dark);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.input-styled {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px; /* input fontSize from brand-spec */
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-medium); /* 8px from brand-spec */
    transition: var(--transition-default);
    outline: none;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    resize: vertical;
    box-sizing: border-box;
}

.input-styled:focus {
    border-color: var(--primary-blue); /* focusBorderColor from brand-spec */
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1); /* focusShadow from brand-spec */
}

/* Options Grid */
.options-grid {
    display: grid;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.options-grid.two-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.options-grid.two-options .option-card {
    min-height: 180px;
}

.options-grid.two-options .option-card span:first-of-type:not(:last-of-type) {
    font-size: 56px;
}

.options-grid.two-options .option-card span:last-of-type {
    font-size: 20px;
}

.options-grid.four-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.options-grid.four-options .option-card {
    min-height: 140px;
}

.options-grid.four-options .option-card span {
    font-size: 22px;
    font-weight: 800;
}

.options-grid.five-options {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.options-grid.five-options .option-card {
    grid-column: span 2;
}

.options-grid.five-options .option-card:nth-child(4),
.options-grid.five-options .option-card:nth-child(5) {
    grid-column: span 3;
    aspect-ratio: auto;
    min-height: 140px;
}

.options-grid.six-options {
    grid-template-columns: repeat(3, 1fr);
}

/* Timeline options with larger font size and emojis - centered layout */
.options-grid.timeline-options {
    max-width: 480px;
    margin: 0 auto;
    gap: 10px;
}

.options-grid.timeline-options .option-card {
    min-height: 150px;
    padding: 10px;
}

.options-grid.timeline-options .option-card span:first-child {
    font-size: 48px;
    margin-bottom: 8px;
}

.options-grid.timeline-options .option-card span:last-child {
    font-size: 18px;
    font-weight: 800;
}

.option-card {
    background: var(--bg-white); /* card.background from brand-spec */
    border: 1px solid var(--border-gray); /* card.border from brand-spec */
    border-radius: var(--radius-large); /* card.borderRadius 12px from brand-spec */
    padding: 12px;
    cursor: pointer;
    transition: var(--transition-default);
    font-weight: var(--font-weight-bold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    min-height: 100px;
    aspect-ratio: 1 / 1;
    position: relative;
}

.option-card span {
    line-height: 1.2;
}

.option-card span:first-of-type:not(:last-of-type) {
    font-size: 52px; /* Uniform larger icon */
    margin-bottom: 8px;
}

.option-card span:last-of-type {
    font-size: 18px; /* Uniform larger text */
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.option-card:hover {
    border-color: var(--primary-blue);
    background-color: var(--light-blue);
}

.option-card.selected {
    border-color: var(--primary-blue); /* card.selectedBorderColor from brand-spec */
    background-color: var(--light-blue); /* card.selectedBackground from brand-spec */
    border-width: 3px; /* card.selectedBorderWidth from brand-spec */
    padding: 10px; /* Offset for border width */
}

/* Checkmark Icon for Selected Options */
.option-card.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Status Message Area - Centered */
.status-message-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 16px 0;
}

/* Collapse status-message-area when empty (no visible status boxes) */
.status-message-area:empty,
.status-message-area:not(:has(.status-box[style*="display: flex"])):not(:has(.status-box[style*="display: block"])) {
    display: none !important;
    margin: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
}

/* Step 1 specific elements */
#zip-city-display {
    color: var(--status-success); /* Using brand status.success color */
    font-weight: var(--font-weight-semibold);
    font-size: 14px; /* small from brand-spec */
    margin-top: 8px;
    margin-bottom: 0;
}

#zip-city-display:not(:empty) {
    margin-bottom: 16px;
}

#zip-instruction-message {
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-top: 16px;
    margin-bottom: 16px;
    transition: opacity 0.2s ease, height 0.2s ease, margin 0.2s ease, padding 0.2s ease;
}

/* When instruction message is hidden, collapse completely */
#zip-instruction-message[style*="display: none"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Trust indicators base style */
.trust-indicators {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 0;
    padding-bottom: 0;
    font-size: 14px;
    color: #999;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.trust-indicators span {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

/* Status Boxes */
.status-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
    /* CLS Optimization: Reserve minimum height to prevent shifts */
    min-height: 50px;
    /* CLS Optimization: Use contain to prevent layout shifts */
    contain: layout style;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.status-box .success-icon,
.status-box .error-icon {
    flex-shrink: 0;
}

.status-text-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.status-subtext {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.9;
}

.status-checking {
    background-color: var(--status-info-bg); /* status.infoBg from brand-spec */
    color: var(--status-info); /* status.info from brand-spec */
    border: 1px solid var(--status-info-border); /* status.infoBorder from brand-spec */
}

.status-error {
    background-color: var(--status-error-bg); /* status.errorBg from brand-spec */
    color: var(--status-error); /* status.error from brand-spec */
    border: 1px solid var(--status-error-border); /* status.errorBorder from brand-spec */
    border-left: 4px solid var(--status-error);
}

.status-success {
    background-color: var(--status-success-bg); /* status.successBg from brand-spec */
    color: var(--status-success); /* status.success from brand-spec */
    border: 1px solid var(--status-success-border); /* status.successBorder from brand-spec */
    border-left: 4px solid var(--status-success);
    align-items: center;
}

.status-success .success-icon {
    position: absolute;
    left: 20px;
    width: 20px;
    height: 20px;
}

.status-success #zip-success-message {
    flex: 1;
    text-align: center;
    margin: 0 auto;
    padding-left: 35px; /* Space for icon */
    padding-right: 35px; /* Balance the padding */
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 86, 179, 0.1);
    border-top-color: #0056b3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.success-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button Stack */
.button-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    width: 100%;
    align-items: center;
}

/* Reduce spacing between char counter and button on Project Details step */
#step-4 .form-group {
    margin-bottom: 12px; /* Consistent spacing */
}

#step-4 .button-stack {
    margin-top: 16px;
}

/* Centered buttons for timeline step */
#step-5 .button-stack {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 16px;
}

/* Buttons */
.btn-next {
    width: 100%;
    max-width: 100%;
    padding: 14px 20px;
    background-color: var(--primary-blue); /* button.primary.background from brand-spec */
    color: white; /* button.primary.color from brand-spec */
    border: none;
    border-radius: 10px; /* button.primary.borderRadius from brand-spec */
    font-size: 20px; /* Increased for better visibility */
    font-weight: var(--font-weight-extrabold); /* button.primary.fontWeight 800 from brand-spec */
    cursor: pointer;
    margin-top: 16px;
    margin-bottom: 0;
    transition: var(--transition-slow);
    text-transform: uppercase; /* button.primary.textTransform from brand-spec */
    letter-spacing: 0.5px; /* button.primary.letterSpacing from brand-spec */
    white-space: nowrap;
    box-shadow: var(--shadow-button); /* shadows.button from brand-spec */
    position: relative;
    z-index: 1;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    line-height: var(--line-height-button); /* lineHeight.button from brand-spec */
}

.btn-next:hover {
    background-color: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-button-hover); /* shadows.buttonHover from brand-spec */
}

.btn-next:disabled {
    background-color: #cbd5e0;
    color: #718096;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    animation: none;
}

.btn-next.glow-animation {
    animation: buttonGlow 2s infinite ease-in-out;
    will-change: transform, box-shadow;
}

@keyframes buttonGlow {
    0% {
        box-shadow: 0 0 5px rgba(0, 51, 102, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 51, 102, 0.8), 0 0 30px rgba(0, 86, 179, 0.4);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 5px rgba(0, 51, 102, 0.4);
        transform: scale(1);
    }
}

.btn-back {
    width: 100%;
    padding: 15px 24px;
    background-color: transparent; /* button.secondary.background from brand-spec */
    color: var(--text-light); /* button.secondary.color from brand-spec */
    border: 1px solid var(--border-gray); /* button.secondary.border from brand-spec */
    border-radius: 10px; /* button.secondary.borderRadius from brand-spec */
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px; /* button.secondary.fontSize from brand-spec */
    font-weight: var(--font-weight-normal); /* button.secondary.fontWeight 400 from brand-spec */
    cursor: pointer;
    transition: var(--transition-default);
    text-transform: none;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.btn-back:hover {
    background-color: #f8f9fa;
    color: var(--text-medium);
    border-color: var(--text-medium);
}

/* Contractor Preview */
.contractor-preview {
    background: var(--light-blue);
    padding: 25px 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.contractor-header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    min-height: 80px; /* Reserve space for logo + text */
}

.contractor-header-flex img {
    /* CLS Optimization: Always reserve space for images */
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
    /* CLS Optimization: Set aspect-ratio for consistent sizing */
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 10px;
    background: #f0f2f5; /* Placeholder color */
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-shrink: 0;
    /* CLS Optimization: Use visibility instead of display to preserve layout */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.contractor-header-flex img[src^="http"],
.contractor-header-flex img[src^="data:"],
.contractor-header-flex img[src^="/"],
.contractor-header-flex img[src^="api/"] {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0s 0s;
    background: white;
}

.contractor-info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 50px; /* Reserve space for name and rating */
}

.contractor-info-text h3 {
    margin: 0;
    font-size: 20px;
    color: var(--primary-blue);
}

.contractor-info-text p {
    margin: 0;
    font-size: 14px;
    color: var(--text-medium);
}

.matching-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

.matching-icon {
    width: 80px;
    height: 80px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.2);
}

.requirements-summary {
    width: 100%;
    background-color: #f8fbff;
    border: 1px solid #e1e9f5;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.summary-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.req-icon {
    font-size: 18px;
    width: 24px;
    display: flex;
    justify-content: center;
}

.req-text {
    display: flex;
    gap: 6px;
    font-size: 15px;
}

.req-label {
    color: var(--text-medium);
}

.req-value {
    color: var(--primary-blue);
    font-weight: 600;
}

.checklist-container {
    width: 100%;
    margin-top: 10px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    text-align: left;
    color: var(--text-medium);
    font-size: 15px;
    transition: all 0.3s ease;
}

.checklist-item.active {
    color: var(--primary-blue);
    font-weight: 500;
}

.checklist-item.completed {
    color: var(--status-success); /* Using brand status.success color */
}

.check-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checklist-item.active .check-status {
    border-color: var(--primary-blue);
}

.checklist-item.completed .check-status {
    border-color: var(--status-success);
    background-color: var(--status-success);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.checklist-item.completed .check-status svg {
    width: 14px;
    height: 14px;
    color: white;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.spinner-tiny {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 51, 102, 0.1);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.matching-complete-box {
    width: 100%;
    background-color: var(--status-success-bg);
    border: 1px solid var(--status-success-border);
    border-radius: var(--radius-large); /* 12px from brand-spec */
    padding: 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--status-success);
    font-weight: var(--font-weight-semibold);
    animation: fadeIn 0.5s ease;
}

.success-check-large {
    width: 40px;
    height: 40px;
    background-color: var(--status-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.spinner {
    display: none; /* Hide old spinner */
}

/* GMB Button */
.btn-gmb {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--accent-google); /* accent.google from brand-spec */
    color: white;
    text-decoration: none;
    border-radius: var(--radius-medium); /* 8px from brand-spec */
    font-weight: var(--font-weight-bold);
    font-size: 16px; /* body desktop from brand-spec */
    transition: var(--transition-default);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.btn-gmb:hover {
    background-color: #357ae8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

/* Reviews Section */
.reviews-section {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid var(--border-gray);
    padding-top: 15px;
}

.reviews-section h4 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.review-card {
    background: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-gray);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.review-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.review-author {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
}

.review-stars {
    color: var(--accent-star-yellow); /* accent.starYellow from brand-spec */
    font-size: 14px; /* small from brand-spec */
    letter-spacing: 1px;
}

.review-text {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.4;
    font-style: italic;
    max-width: 100%;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 4px 8px 20px 8px; /* Minimal top padding, reduced bottom padding */
        align-items: center;
        justify-content: flex-start;
        font-size: 16px; /* body mobile from brand-spec */
    }

    .simplified-container {
        padding: 20px 12px; /* Significantly reduced padding */
        border-radius: var(--radius-large);
        min-height: auto;
        max-width: 95%;
        margin: 0 auto;
        overflow: visible;
    }
    
    h2 {
        font-size: 24px; /* Reduced from 28px */
        white-space: normal; /* Allow wrapping on very small screens if needed */
        margin-bottom: 12px;
    }
    
    #step-1 h2 {
        font-size: 20px; /* Further reduced for step 1 on mobile */
    }
    
    .subtitle {
        font-size: 12px; /* caption from brand-spec */
        white-space: nowrap;
        letter-spacing: -0.3px;
        padding: 0 2px;
        font-weight: var(--font-weight-medium);
    }
    
    .btn-next {
        font-size: 16px; /* Slightly smaller */
        padding: 10px 14px;
        letter-spacing: 0.3px;
        margin-top: 12px;
    }
    
    .btn-back {
        font-size: 14px; /* button mobile from brand-spec */
        padding: 10px 16px;
    }
    
    .social-proof-badge {
        font-size: 12px; /* Smaller */
        padding: 5px 12px;
        gap: 4px;
        margin-bottom: 10px;
    }
    
    #zip-verification-message {
        font-size: 12px !important; /* caption from brand-spec */
    }
    
    .trust-indicators {
        font-size: 10px !important; /* Smaller to prevent cutoff */
        gap: 2px !important;
        margin-top: 10px !important;
        margin-bottom: 8px !important;
        padding: 0 2px;
    }
    
    .trust-indicators span {
        font-size: 10px;
        gap: 2px;
        flex-shrink: 1;
    }
    
    .trust-indicators span:first-child {
        text-align: left;
        justify-content: flex-start;
    }
    
    .trust-indicators span:last-child {
        text-align: right;
        justify-content: flex-end;
    }
    
    .status-box {
        font-size: 14px; /* small from brand-spec */
        padding: 6px 10px;
        min-height: 38px;
    }

    .options-grid.two-options .option-card {
        min-height: 130px;
        padding: 12px;
    }

    .options-grid.two-options .option-card span:first-of-type:not(:last-of-type) {
        font-size: 44px;
    }

    .options-grid.two-options .option-card span:last-of-type {
        font-size: 16px;
    }
    
    .button-stack {
        margin-top: 4px;
        gap: 6px;
    }
    
    .quote-time-text {
        font-size: 12px !important;
        margin-top: 4px !important;
    }

    .options-grid.four-options .option-card {
        min-height: 120px;
    }

    .options-grid.four-options .option-card span {
        font-size: 18px;
    }

    .options-grid.timeline-options {
        max-width: 100%;
        gap: 8px;
    }

    .options-grid.timeline-options .option-card {
        min-height: 130px;
        padding: 8px;
    }

    .options-grid.timeline-options .option-card span:first-child {
        font-size: 40px;
        margin-bottom: 6px;
    }

    .options-grid.timeline-options .option-card span:last-child {
        font-size: 16px;
    }

    #step-5 .button-stack {
        max-width: 100%;
    }

    .options-grid.five-options {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }

    .options-grid.five-options .option-card {
        grid-column: span 2;
        min-height: 110px;
    }

    .options-grid.five-options .option-card:nth-child(n+4) {
        grid-column: span 3;
        min-height: 110px;
    }

    .option-card span:first-of-type:not(:last-of-type) {
        font-size: 40px;
    }

    .option-card span:last-of-type {
        font-size: 15px;
    }
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-gray);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 20px;
    animation: slideUp 0.3s ease;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 250px;
}

.cookie-consent-text h3 {
    color: var(--primary-blue);
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    margin: 0 0 4px 0;
}

.cookie-consent-text p {
    color: var(--text-medium);
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.cookie-consent-options {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin: 0;
}

.cookie-option-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.cookie-option-yes {
    background-color: var(--light-blue);
    border-color: var(--secondary-blue);
}

.cookie-option-label:hover {
    background-color: #f5f5f5;
}

.cookie-option-yes:hover {
    background-color: #d6e7ff;
}

.cookie-option-label input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--secondary-blue);
}

.cookie-option-label input[type="radio"]:checked {
    accent-color: var(--secondary-blue);
}

.cookie-consent-buttons {
    margin: 0;
}

.cookie-consent-btn {
    padding: 10px 20px;
    background-color: var(--secondary-blue);
    color: white;
    border: none;
    border-radius: var(--radius-medium); /* 8px from brand-spec */
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-default);
    white-space: nowrap;
}

.cookie-consent-btn-primary {
    background-color: var(--secondary-blue);
}

.cookie-consent-btn-secondary {
    background-color: #f0f2f5; /* Very light gray */
    color: var(--text-dark);
    border: 1px solid #e4e6eb;
}

.cookie-consent-btn:hover {
    background-color: #004494;
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

.cookie-consent-btn-secondary:hover {
    background-color: #e9ecef;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: none; /* No shadow for secondary button */
}

.cookie-consent-btn:active {
    transform: translateY(0);
}

.cookie-consent-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-light);
    margin: 0;
    padding: 0;
    border: none;
}

.cookie-consent-links a {
    color: var(--secondary-blue);
    text-decoration: none;
    font-weight: 500;
}

.cookie-consent-links a:hover {
    text-decoration: underline;
}

.cookie-consent-links span {
    color: var(--text-light);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 12px 15px;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cookie-consent-text {
        min-width: auto;
    }

    .cookie-consent-text h3 {
        font-size: 15px;
    }

    .cookie-consent-text p {
        font-size: 12px;
    }

    .cookie-consent-options {
        justify-content: stretch;
    }

    .cookie-option-label {
        flex: 1;
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .cookie-consent-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ============================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================ */

/* Skip Link for Keyboard Users */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
}

.skip-link:focus {
    top: 0;
    clip: auto;
    outline: 3px solid #4299e1;
    outline-offset: 2px;
}

/* Visually Hidden (Screen Reader Only) */
.visually-hidden,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced Focus Indicators - Using brand accessibility values */
*:focus-visible {
    outline: 3px solid #4299e1; /* accessibility.focusOutline from brand-spec */
    outline-offset: 2px; /* accessibility.focusOutlineOffset from brand-spec */
}

button:focus-visible,
.btn-next:focus-visible,
.btn-back:focus-visible {
    outline: 3px solid #4299e1; /* accessibility.focusOutline from brand-spec */
    outline-offset: 2px; /* accessibility.focusOutlineOffset from brand-spec */
    box-shadow: 0 0 0 6px rgba(66, 153, 225, 0.3);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #4299e1; /* accessibility.focusOutline from brand-spec */
    outline-offset: 1px;
    border-color: #4299e1;
}

/* Validation States */
input.valid,
textarea.valid {
    border-color: var(--status-success); /* status.success from brand-spec */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232f855a' stroke-width='2'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

input.invalid,
textarea.invalid,
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--status-error); /* status.error from brand-spec */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23c53030' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

/* Error Message Styling */
.field-error {
    color: var(--status-error); /* status.error from brand-spec */
    font-size: 14px; /* small from brand-spec */
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-error::before {
    content: '⚠';
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 12px;
}

.skeleton-button {
    height: 48px;
    width: 100%;
    border-radius: 8px;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 20px;
    border-radius: 12px;
    background: #fff;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   OFFLINE INDICATOR
   ============================================================ */

.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #e53e3e;
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ============================================================
   MOBILE UX IMPROVEMENTS
   ============================================================ */

@media (max-width: 768px) {
    /* Larger tap targets - accessibility.minTouchTarget from brand-spec */
    button,
    .btn,
    .btn-next,
    .btn-back,
    input[type="radio"] + label,
    input[type="checkbox"] + label {
        min-height: 44px; /* accessibility.minTouchTarget from brand-spec */
        min-width: 44px; /* accessibility.minTouchTarget from brand-spec */
    }
    
    /* Better mobile keyboard handling */
    input:focus,
    textarea:focus,
    select:focus {
        scroll-margin-top: 120px;
    }
    
    /* Prevent zoom on input focus (iOS) - body mobile from brand-spec */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px; /* body mobile from brand-spec */
    }
}

/* Touch-friendly option cards */
@media (pointer: coarse) {
    .option-card {
        padding: 18px 20px;
    }
    
    .option-cards {
        gap: 12px;
    }
}

/* ============================================================
   REDUCED MOTION PREFERENCE
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .skeleton {
        animation: none;
        background: #e0e0e0;
    }
}

/* ============================================================
   HIGH CONTRAST MODE
   ============================================================ */

@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0000ee;
        --text-dark: #000000;
        --bg-white: #ffffff;
        --border-gray: #000000;
    }
    
    button,
    input,
    textarea,
    select {
        border-width: 2px;
    }
    
    .btn-next {
        border: 2px solid #000;
    }
}

/* Summary Page Styles */
.deal-banner {
    background-color: var(--accent-dark); /* accent.dark from brand-spec */
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-medium); /* 8px from brand-spec */
    text-align: center;
    font-weight: var(--font-weight-extrabold);
    font-size: 14px; /* small from brand-spec */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-badge);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.summary-card {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-large); /* 12px from brand-spec */
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    min-height: 140px;
    transition: var(--transition-default);
}

.summary-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.summary-icon {
    font-size: 36px;
    margin-bottom: 5px;
}

.summary-label {
    font-size: 11px;
    color: var(--text-medium);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 700;
    word-break: break-word;
    line-height: 1.3;
}

/* Matching Modal Styles */
.matching-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    animation: fadeIn 0.3s ease;
}

.matching-modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-xlarge); /* 16px from brand-spec */
    padding: 40px 30px;
    max-width: 550px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal); /* shadows.modal from brand-spec */
    position: relative;
    animation: slideUp 0.3s ease;
    margin-top: 20px;
    margin-bottom: 20px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments for summary */
@media (max-width: 600px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .summary-card {
        min-height: 120px;
        padding: 12px;
    }

    .summary-icon {
        font-size: 32px;
    }

    .summary-label {
        font-size: 10px;
    }

    .summary-value {
        font-size: 12px;
    }

    .matching-modal-content {
        padding: 30px 20px;
        max-height: 85vh;
        margin-top: 30px;
        margin-bottom: 30px;
    }
}
