/* 
 * Building Operations & Risk Management Survey
 * Custom Styles - Mobile-First Design
 * =====================================
 * Enhanced for all device sizes and screen orientations
 */

/* CSS Custom Properties (Variables) */
:root {
    /* Primary Color Palette - Deep Blue Professional */
    --primary-900: #0c1929;
    --primary-800: #132337;
    --primary-700: #1a365d;
    --primary-600: #234681;
    --primary-500: #2c5282;
    --primary-400: #3182ce;
    --primary-300: #63b3ed;
    --primary-200: #90cdf4;
    --primary-100: #bee3f8;
    --primary-50: #ebf8ff;
    
    /* Accent Colors */
    --accent-orange: #ed8936;
    --accent-green: #38a169;
    --accent-red: #e53e3e;
    --accent-teal: #319795;
    
    /* Neutrals */
    --gray-900: #1a202c;
    --gray-800: #2d3748;
    --gray-700: #4a5568;
    --gray-600: #718096;
    --gray-500: #a0aec0;
    --gray-400: #cbd5e0;
    --gray-300: #e2e8f0;
    --gray-200: #edf2f7;
    --gray-100: #f7fafc;
    --gray-50: #fafbfc;
    
    /* Functional Colors */
    --success: var(--accent-green);
    --warning: var(--accent-orange);
    --danger: var(--accent-red);
    --info: var(--primary-400);
    
    /* Typography */
    --font-family-base: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --section-padding: 1.25rem;
    --card-border-radius: 16px;
    --input-border-radius: 10px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Touch targets - minimum 44px for mobile */
    --min-touch-target: 44px;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-base);
    background: linear-gradient(180deg, var(--gray-100) 0%, var(--gray-200) 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px; /* Prevent zoom on iOS when focusing inputs */
}

/* NYC Skyline Background */
.skyline-bg {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: 
        linear-gradient(to top, rgba(26, 54, 93, 0.08) 0%, transparent 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' preserveAspectRatio='xMidYMax slice'%3E%3Cpath fill='%231a365d' fill-opacity='0.06' d='M0,200 L0,140 L30,140 L30,120 L50,120 L50,100 L60,100 L60,80 L80,80 L80,60 L100,60 L100,80 L120,80 L120,100 L140,100 L140,60 L160,60 L160,40 L180,40 L180,60 L200,60 L200,100 L220,100 L220,80 L240,80 L240,120 L260,120 L260,100 L280,100 L280,140 L300,140 L300,120 L320,120 L320,80 L340,80 L340,60 L360,60 L360,30 L380,30 L380,60 L400,60 L400,100 L420,100 L420,80 L440,80 L440,120 L460,120 L460,140 L480,140 L480,100 L500,100 L500,60 L520,60 L520,40 L540,40 L540,20 L560,20 L560,40 L580,40 L580,80 L600,80 L600,60 L620,60 L620,100 L640,100 L640,120 L660,120 L660,80 L680,80 L680,50 L700,50 L700,30 L720,30 L720,50 L740,50 L740,80 L760,80 L760,120 L780,120 L780,100 L800,100 L800,60 L820,60 L820,40 L840,40 L840,60 L860,60 L860,100 L880,100 L880,140 L900,140 L900,120 L920,120 L920,80 L940,80 L940,100 L960,100 L960,60 L980,60 L980,80 L1000,80 L1000,120 L1020,120 L1020,100 L1040,100 L1040,140 L1060,140 L1060,120 L1080,120 L1080,100 L1100,100 L1100,140 L1120,140 L1120,160 L1140,160 L1140,140 L1160,140 L1160,120 L1180,120 L1180,140 L1200,140 L1200,200 Z'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: bottom;
    pointer-events: none;
    z-index: 0;
}

/* Survey Container */
.survey-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
}

/* Header */
.survey-header {
    background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-700) 50%, var(--primary-600) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.logo-text .tagline {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
    display: block;
}

/* Progress Section */
.progress-section {
    background: white;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.step-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.section-name {
    font-size: 0.8rem;
    color: var(--gray-700);
    font-weight: 500;
}

.progress-bar-container {
    margin-bottom: 0.75rem;
}

.progress {
    height: 6px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-400) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Step Dots */
.step-dots {
    display: flex;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--gray-200);
    color: var(--gray-500);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-dot.active {
    background: var(--primary-500);
    color: white;
    box-shadow: 0 0 0 3px var(--primary-100);
    transform: scale(1.1);
}

.step-dot.completed {
    background: var(--accent-green);
    color: white;
}

.step-dot.completed i {
    font-size: 0.8rem;
}

/* Main Content */
.survey-main {
    flex: 1;
    padding: 1rem 0 6rem; /* Extra bottom padding for mobile keyboards */
}

/* Survey Card */
.survey-card {
    background: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.card-header-custom {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%);
    color: white;
    padding: 1rem var(--section-padding);
}

.card-header-custom h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-header-custom .section-description {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.4rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.card-body-custom {
    padding: var(--section-padding);
}

/* Form Elements - Mobile Optimized */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.6rem;
    display: block;
    font-size: 0.9rem;
    line-height: 1.5;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--primary-500);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.form-label-text {
    flex: 1;
}

/* Input Styling - Touch Optimized */
.form-control,
.form-select {
    border: 2px solid var(--gray-300);
    border-radius: var(--input-border-radius);
    padding: 0.75rem 1rem;
    font-size: 16px; /* Prevent iOS zoom */
    transition: all 0.2s ease;
    background-color: var(--gray-50);
    min-height: var(--min-touch-target);
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
    background-color: white;
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-500);
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

/* Character counter */
.form-text {
    margin-top: 0.25rem;
}

/* Large Touch-Friendly Checkboxes and Radios */
.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.option-item {
    position: relative;
}

.option-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.option-label {
    display: flex;
    align-items: flex-start;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-300);
    border-radius: var(--input-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    line-height: 1.4;
    gap: 0.6rem;
    min-height: var(--min-touch-target);
    -webkit-tap-highlight-color: transparent;
}

.option-label:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.option-label:active {
    transform: scale(0.98);
}

.option-input:checked + .option-label {
    background: var(--primary-50);
    border-color: var(--primary-500);
    color: var(--primary-700);
}

.option-input:focus + .option-label {
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Custom checkbox/radio indicator */
.option-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--gray-400);
    background: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin-top: 1px;
}

.option-input[type="checkbox"] + .option-label .option-indicator {
    border-radius: 5px;
}

.option-input[type="radio"] + .option-label .option-indicator {
    border-radius: 50%;
}

.option-input:checked + .option-label .option-indicator {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.option-input:checked + .option-label .option-indicator::after {
    content: '';
    display: block;
}

.option-input[type="checkbox"]:checked + .option-label .option-indicator::after {
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.option-input[type="radio"]:checked + .option-label .option-indicator::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.option-text {
    flex: 1;
    padding-top: 1px;
}

/* Conditional Fields */
.conditional-field {
    display: none;
    margin-top: 0.6rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-300);
    animation: fadeIn 0.3s ease;
}

.conditional-field.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Contact Info Section */
.contact-section {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
    border-radius: var(--input-border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--primary-100);
}

.contact-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    border-radius: var(--input-border-radius);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: var(--min-touch-target);
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
    border: none;
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-secondary {
    background: white;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green) 0%, #2f855a 100%);
    border: none;
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    background: linear-gradient(135deg, #2f855a 0%, #276749 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-next {
    margin-left: auto;
}

/* Footer */
.survey-footer {
    background: var(--gray-100);
    padding: 0.875rem 0;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.8rem;
    border-top: 1px solid var(--gray-200);
}

/* Auto-save Indicator */
.auto-save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gray-800);
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.auto-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Validation States */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--accent-red);
    background-image: none;
}

.was-validated .form-control:invalid:focus,
.was-validated .form-select:invalid:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.2);
}

.was-validated .option-input:invalid + .option-label {
    border-color: var(--accent-red);
}

.invalid-feedback {
    color: var(--accent-red);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

/* Required field indicator */
.required-indicator {
    color: var(--accent-red);
    margin-left: 0.2rem;
}

/* Thank You Page */
.thank-you-page {
    text-align: center;
    padding: 1.5rem 0;
}

.thank-you-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-green) 0%, #2f855a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 10px 40px rgba(56, 161, 105, 0.3);
}

.thank-you-icon i {
    font-size: 2.5rem;
    color: white;
}

.thank-you-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.thank-you-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Recommendations Cards */
.recommendations-section {
    margin-top: 1.5rem;
}

.recommendations-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.875rem;
    text-align: left;
}

.recommendation-card {
    background: var(--gray-50);
    border-radius: var(--input-border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-500);
    text-align: left;
    transition: all 0.2s ease;
}

.recommendation-card:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

.recommendation-icon {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}

.recommendation-title {
    font-weight: 600;
    color: var(--primary-700);
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.recommendation-text {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* Error Page */
.error-page {
    padding: 2rem 1rem;
}

.error-icon {
    margin-bottom: 1rem;
}

.error-code {
    margin-bottom: 0.75rem;
}

.error-title {
    margin-bottom: 0.75rem;
}

.error-message {
    margin-bottom: 1.5rem;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

/* Alert Styling */
.alert {
    border-radius: var(--input-border-radius);
    border: none;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fff5f5;
    color: var(--accent-red);
}

.alert-success {
    background: #f0fff4;
    color: var(--accent-green);
}

.alert-warning {
    background: #fffaf0;
    color: #c05621;
}

.alert-info {
    background: var(--primary-50);
    color: var(--primary-700);
}

/* Intro Text */
.intro-text {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--gray-100) 100%);
    border-radius: var(--input-border-radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--primary-400);
}

.intro-text p {
    margin: 0;
    color: var(--gray-700);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Small phones (320px - 374px) */
@media (max-width: 374px) {
    :root {
        --section-padding: 1rem;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .step-dot {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }
    
    .card-header-custom h2 {
        font-size: 0.95rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    .option-label {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-buttons {
        flex-direction: column;
    }
    
    .btn-next {
        margin-left: 0;
        width: 100%;
    }
    
    .btn-outline-secondary {
        width: 100%;
    }
}

/* Standard phones (375px - 575px) */
@media (min-width: 375px) and (max-width: 575px) {
    .survey-card {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }
}

/* Large phones / Small tablets (576px - 767px) */
@media (min-width: 576px) {
    :root {
        --section-padding: 1.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.35rem;
    }
    
    .logo-text .tagline {
        font-size: 0.85rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .step-indicator {
        flex-wrap: nowrap;
    }
    
    .step-dot {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .survey-card {
        margin-left: auto;
        margin-right: auto;
        max-width: 600px;
    }
    
    .card-header-custom h2 {
        font-size: 1.15rem;
    }
    
    .form-label {
        font-size: 0.95rem;
    }
    
    .option-label {
        font-size: 0.95rem;
    }
    
    .thank-you-icon {
        width: 90px;
        height: 90px;
    }
    
    .thank-you-icon i {
        font-size: 2.75rem;
    }
    
    .thank-you-title {
        font-size: 1.75rem;
    }
    
    .error-actions {
        flex-direction: row;
    }
}

/* Tablets (768px - 991px) */
@media (min-width: 768px) {
    .survey-header {
        padding: 1.25rem 0;
    }
    
    .logo-icon {
        font-size: 2.25rem;
    }
    
    .logo-text h1 {
        font-size: 1.5rem;
    }
    
    .progress-section {
        padding: 1rem 0;
    }
    
    .progress {
        height: 8px;
    }
    
    .step-dot {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    .survey-main {
        padding: 1.5rem 0 4rem;
    }
    
    .survey-card {
        max-width: 700px;
    }
    
    .card-body-custom {
        padding: 2rem;
    }
    
    .form-group {
        margin-bottom: 1.75rem;
    }
    
    .question-number {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
    
    .option-indicator {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }
    
    .thank-you-icon {
        width: 100px;
        height: 100px;
    }
    
    .thank-you-icon i {
        font-size: 3rem;
    }
    
    .thank-you-title {
        font-size: 2rem;
    }
    
    .skyline-bg {
        height: 200px;
    }
}

/* Desktops (992px+) */
@media (min-width: 992px) {
    .survey-main {
        padding: 2rem 0 4rem;
    }
    
    .survey-card {
        max-width: 750px;
    }
    
    .skyline-bg {
        height: 250px;
    }
    
    .option-group {
        gap: 0.5rem;
    }
    
    .recommendation-card:hover {
        transform: translateX(5px);
    }
}

/* Large desktops (1200px+) */
@media (min-width: 1200px) {
    .survey-card {
        max-width: 800px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .survey-header {
        padding: 0.5rem 0;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text .tagline {
        display: none;
    }
    
    .progress-section {
        padding: 0.5rem 0;
    }
    
    .step-dots {
        display: none;
    }
    
    .survey-main {
        padding: 0.5rem 0 2rem;
    }
    
    .card-header-custom {
        padding: 0.75rem var(--section-padding);
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .skyline-bg {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .option-label {
        border-width: 3px;
    }
    
    .form-control,
    .form-select {
        border-width: 3px;
    }
    
    .step-dot.active {
        box-shadow: 0 0 0 4px var(--primary-100);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .option-label:active {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .recommendation-card:hover {
        transform: none;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --gray-50: #1a202c;
        --gray-100: #2d3748;
        --gray-200: #4a5568;
        --gray-300: #718096;
        --gray-400: #a0aec0;
        --gray-500: #cbd5e0;
        --gray-600: #e2e8f0;
        --gray-700: #edf2f7;
        --gray-800: #f7fafc;
        --gray-900: #ffffff;
    }
    
    body {
        background: linear-gradient(180deg, var(--gray-100) 0%, var(--gray-50) 100%);
        color: var(--gray-800);
    }
    
    .survey-card {
        background: var(--gray-100);
    }
    
    .form-control,
    .form-select {
        background-color: var(--gray-50);
        color: var(--gray-800);
        border-color: var(--gray-300);
    }
    
    .option-label {
        background: var(--gray-50);
        border-color: var(--gray-300);
    }
    */
}

/* Print styles */
@media print {
    .skyline-bg,
    .nav-buttons,
    .progress-section,
    .survey-header,
    .survey-footer,
    .auto-save-indicator {
        display: none !important;
    }
    
    .survey-card {
        box-shadow: none;
        border: 1px solid #ddd;
        margin: 0;
        max-width: 100%;
    }
    
    .card-header-custom {
        background: #f5f5f5 !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    body {
        background: white !important;
    }
}

/* Safe area insets for notched phones (iPhone X+) */
@supports (padding: max(0px)) {
    .survey-header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .survey-main {
        padding-bottom: max(4rem, env(safe-area-inset-bottom));
    }
    
    .survey-footer {
        padding-bottom: max(0.875rem, env(safe-area-inset-bottom));
    }
    
    .auto-save-indicator {
        bottom: max(20px, env(safe-area-inset-bottom));
    }
}
