/* ================================
   Home Value Haven - Complete Stylesheet
   Works with Bootstrap 5
   OPTIMIZED FOR MOBILE & DESKTOP
   Color Scheme: Red (#b5121b, #d42833)
   ================================ */

/* CSS Variables */
:root {
    --primary-color: #b5121b;
    --primary-dark: #8a0e15;
    --primary-light: #d42833;
    --accent-color: #b5121b;
    --accent-light: #d42833;
    --accent-dark: #8a0e15;
    --success-color: #b5121b;
    --text-dark: #212121;
    --text-medium: #333333;
    --text-light: #757575;
    --white: #ffffff;
    --background-light: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #b5121b 0%, #d42833 100%);
    --gradient-accent: linear-gradient(135deg, #b5121b 0%, #d42833 100%);
    --shadow-sm: 0 2px 8px rgba(181, 18, 27, 0.08);
    --shadow-md: 0 4px 16px rgba(181, 18, 27, 0.12);
    --shadow-lg: 0 8px 32px rgba(181, 18, 27, 0.16);
    --shadow-xl: 0 16px 48px rgba(181, 18, 27, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    /* Touch-friendly minimum sizes */
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;
    /* Safe area for notched devices */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

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

html { 
    scroll-behavior: smooth; 
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%) fixed;
    background-repeat: no-repeat;
    background-size: cover;
    /* Fix for mobile viewport height */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Fixed body layout to prevent footer from going off-screen */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%) fixed;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding-bottom: var(--safe-area-bottom);
    /* Prevent text inflation on mobile */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { 
    font-weight: 700; 
    line-height: 1.2; 
    color: #161928;
}

h1 { 
    font-size: clamp(1.75rem, 5vw, 3rem); 
    letter-spacing: -0.02em; 
}

h2 { 
    font-size: clamp(1.75rem, 4vw, 2.5rem); 
    letter-spacing: -0.01em; 
}

h3 { 
    font-size: clamp(1.5rem, 3vw, 2rem); 
}

h4 { 
    font-size: clamp(1.25rem, 2.5vw, 1.75rem); 
}

/* Global Link Colors - Override Bootstrap Blue */
a {
    color: #b5121b;
    text-decoration: none;
    transition: color 0.3s ease;
    /* Ensure touch targets on links */
    -webkit-tap-highlight-color: rgba(181, 18, 27, 0.1);
}

a:hover {
    color: #8a0e15;
    text-decoration: underline;
}

/* Primary Color Text */
.primary-color {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.primary-sub-text {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-light);
    font-weight: 500;
    text-align: center;
    margin: 2rem auto;
}

/* ================================
   HEADER STYLES
   ================================ */

header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-base);
    flex-shrink: 0;
    padding-top: var(--safe-area-top);
}

header.scrolled { 
    box-shadow: var(--shadow-md); 
}

header .container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

.logo { 
    max-height: 60px; 
    width: auto; 
    transition: transform var(--transition-base); 
    margin: 0 auto; 
}

.logo:hover { 
    transform: scale(1.05); 
}

header .word-wrap { 
    font-size: 0.95rem; 
    line-height: 1.4; 
}

header .circle-draw { 
    display: inline-block; 
    position: relative; 
    padding: 0 8px; 
}

header .circle-draw::after {
    content: '';
    position: absolute; 
    left: -5px; 
    right: -5px; 
    top: -3px; 
    bottom: -3px;
    border: 3px solid var(--accent-color); 
    border-radius: 50%;
    transform: rotate(-5deg); 
    animation: drawCircle 0.6s ease-out 0.5s both;
}

@keyframes drawCircle {
    from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
    to   { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

/* ================================
   MAIN SECTION
   ================================ */

.section-main {
    background: transparent;
    padding: 1.5rem 0 2rem 0;
    position: relative;
    overflow: visible;
    min-height: 0;
    flex: 1 0 auto;
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
}

.section-main::before {
    content: '';
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23161928' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.wrapper-narrow-maxwidth { 
    max-width: 1100px; 
    width: 100%;
    margin: 0 auto; 
    position: relative; 
    z-index: 1;
    padding: 0 1rem;
}

.section-main h1 { 
    margin-bottom: 0.5rem; 
}

.section-main .primary-sub-text { 
    margin: 0.5rem auto 1rem; 
    font-size: 1.1rem; 
}

/* ================================
   PROGRESS BAR - ENHANCED
   ================================ */

.progress-wrapper { 
    margin-bottom: 1.5rem; 
    background: transparent; 
    padding: 0.5rem 0; 
}

.progress {
    height: 14px;
    border-radius: 50px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 0;
    border: 2px solid #e0e0e0;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-accent);
    transition: width 0.5s ease;
    border-radius: 50px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    font-weight: 700;
    color: var(--white);
    font-size: 0.75rem;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-status-text { 
    text-align: center; 
    color: var(--text-light); 
    font-size: 0.875rem; 
    margin: 0.5rem 0 0 0; 
}

#current-step { 
    font-weight: 700; 
    color: var(--text-light); 
}

/* ================================
   FORM WRAPPER - ENHANCED
   ================================ */

.form-wrapper { 
    background: var(--white); 
    border-radius: var(--radius-xl); 
    padding: 2rem 2rem 2.25rem 2rem; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); 
    margin: 1rem auto; 
    position: relative;
    max-width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ================================
   FORM STEPS
   ================================ */

.form-steps { 
    display: none; 
    animation: fadeIn 0.5s ease-out; 
}

.form-steps:first-of-type { 
    display: block; 
}

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

.form-steps legend.questions,
.form-steps h3 { 
    color: #161928; 
    margin-bottom: 1.5rem; 
    font-size: clamp(1.25rem, 4vw, 1.75rem); 
    font-weight: 700; 
    text-align: center; 
    line-height: 1.2;
}

.form-steps p { 
    color: #161928; 
    margin-bottom: 1.5rem; 
    line-height: 1.6; 
    text-align: center;
    font-size: 1rem;
}

/* ================================
   SELECTION BOXES - ENHANCED TOUCH
   ================================ */

.select-box { 
    cursor: pointer; 
    transition: all var(--transition-base); 
    height: 100%; 
    margin-bottom: 1rem; 
}

.select-label-option {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    padding: 1.25rem 0.875rem; 
    border: 3px solid #e0e0e0; 
    border-radius: 16px; 
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); 
    transition: all var(--transition-base);
    cursor: pointer; 
    height: 100%; 
    min-height: 110px; 
    position: relative; 
    overflow: hidden;
    /* Enhanced touch feedback */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Override Bootstrap for select boxes */
.select-label-option.form-label { 
    display: flex !important; 
    flex-direction: column !important; 
    align-items: center !important; 
    justify-content: center !important; 
    text-align: center !important; 
}

.select-label-option::before {
    content: ''; 
    position: absolute; 
    inset: 0; 
    background: var(--gradient-primary); 
    opacity: 0; 
    transition: opacity var(--transition-base); 
    z-index: 0;
}

.select-label-option::after {
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    height: 5px; 
    background: var(--gradient-accent);
    transform: scaleX(0); 
    transition: transform var(--transition-base);
}

/* Desktop hover states */
@media (hover: hover) and (pointer: fine) {
    .select-box:hover .select-label-option, 
    .select-label-option.clickable:hover {
        transform: translateY(-8px) scale(1.02); 
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15); 
        border-color: var(--primary-color);
    }
    
    .select-box:hover .select-label-option::before { 
        opacity: 0.06; 
    }
    
    .select-box:hover .select-label-option::after { 
        transform: scaleX(1); 
    }
    
    .select-box:hover .select-img { 
        filter: grayscale(0%) brightness(100%); 
        opacity: 1; 
        transform: scale(1.15); 
    }
    
    .select-box:hover .box-option-title { 
        color: var(--primary-color); 
    }
}

/* Touch device active states */
@media (hover: none) and (pointer: coarse) {
    .select-box:active .select-label-option, 
    .select-label-option.clickable:active {
        transform: scale(0.98); 
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); 
        border-color: var(--primary-color);
        background: rgba(181, 18, 27, 0.05);
    }
    
    .select-box:active .select-label-option::before { 
        opacity: 0.1; 
    }
    
    .select-box:active .select-label-option::after { 
        transform: scaleX(1); 
    }
}

.select-box input[type="radio"] { 
    position: absolute; 
    opacity: 0; 
    pointer-events: none; 
}

.select-img {
    width: 56px; 
    height: 56px; 
    object-fit: contain; 
    margin-bottom: 0.5rem;
    margin-left: auto !important; 
    margin-right: auto !important; 
    filter: grayscale(0%) brightness(0) saturate(100%);
    opacity: 0.85; 
    transition: all var(--transition-base); 
    position: relative; 
    z-index: 1;
}

.box-option-title {
    font-size: 1rem; 
    font-weight: 800; 
    color: #161928; 
    text-align: center !important; 
    width: 100% !important;
    position: relative; 
    z-index: 1; 
    transition: color var(--transition-base); 
    letter-spacing: -0.01em;
}

.box-option-title small { 
    font-size: 0.8rem; 
    font-weight: 500; 
    display: block; 
    margin-top: 0.25rem; 
}

/* Row spacing */
.section-main .row.justify-content-center { 
    row-gap: 1rem; 
}

/* ================================
   FORM CONTROLS - ENHANCED
   ================================ */

.input-field-wrapper { 
    margin-bottom: 1rem; 
}

.form-control, 
.form-control-lg {
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    font-size: 16px; /* Prevents iOS zoom on focus */
    transition: all var(--transition-base);
    background: var(--white);
    color: #161928;
    font-weight: 500;
    /* Enhanced touch targets */
    min-height: var(--touch-target-min);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus, 
.form-control-lg:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(181, 18, 27, 0.12);
    outline: none;
    background: var(--white);
}

.form-control.error { 
    border-color: #dc3545; 
}

.form-control.valid { 
    border-color: #10b981; 
}

.form-label { 
    font-weight: 600; 
    color: #161928; 
    margin-bottom: 0.5rem; 
    font-size: 0.9rem; 
    display: block; 
}

.form-select, 
.form-select-lg {
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    padding: 0.9rem 2.5rem 0.9rem 1.1rem;
    font-size: 16px; /* Prevents iOS zoom on focus */
    transition: all var(--transition-base);
    background: var(--white);
    cursor: pointer;
    color: #161928;
    font-weight: 500;
    /* Enhanced touch targets */
    min-height: var(--touch-target-min);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

.form-select:focus, 
.form-select-lg:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(181, 18, 27, 0.12);
    outline: none;
}

.text-muted {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Input Groups */
.input-group-text {
    background: linear-gradient(135deg, rgba(181, 18, 27, 0.1), rgba(138, 14, 21, 0.1));
    border: 2px solid #e0e0e0;
    border-right: none;
    color: var(--primary-color);
    font-weight: 700;
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--accent-color);
}

.input-group:focus-within .form-control {
    border-left: none;
}

/* ================================
   ENHANCED RADIO BUTTON CARDS
   ================================ */

.form-check {
    margin-bottom: 0;
    position: relative;
}

.form-check-input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.form-check-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    background: var(--white);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 600;
    font-size: 1rem;
    color: #161928;
    text-align: center;
    min-height: var(--touch-target-comfortable);
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Desktop hover states for form-check-label */
@media (hover: hover) and (pointer: fine) {
    .form-check-label:hover {
        border-color: var(--accent-color);
        background: rgba(181, 18, 27, 0.05);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(181, 18, 27, 0.15);
    }
}

/* Touch active states for form-check-label */
@media (hover: none) and (pointer: coarse) {
    .form-check-label:active {
        border-color: var(--accent-color);
        background: rgba(181, 18, 27, 0.1);
        transform: scale(0.98);
    }
}

.form-check-input[type="radio"]:checked + .form-check-label {
    background: linear-gradient(135deg, rgba(181, 18, 27, 0.15) 0%, rgba(212, 40, 51, 0.15) 100%);
    border-color: var(--accent-color);
    border-width: 3px;
    color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(181, 18, 27, 0.25);
}

.form-check-input[type="radio"]:checked + .form-check-label::before {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: checkmarkPop 0.3s ease-out;
}

@keyframes checkmarkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.form-check-input[type="radio"]:focus + .form-check-label {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ================================
   CLEAN THIN SLIDER
   ================================ */

.form-range,
input[type="range"],
.form-wrapper input[type="range"],
.form-steps input[type="range"],
input.form-range,
.form-control.form-range {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: 6px !important;
    min-height: 6px !important;
    max-height: 6px !important;
    padding: 0 !important;
    border-radius: 3px !important;
    background: linear-gradient(to right, 
        #b5121b 0%, 
        #b5121b var(--val, 0%), 
        #e5e7eb var(--val, 0%), 
        #e5e7eb 100%) !important;
    outline: none !important;
    margin: 2rem 0 1.5rem 0 !important;
    cursor: pointer !important;
    position: relative !important;
    border: none !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    vertical-align: middle !important;
    touch-action: pan-x;
}

/* WebKit (Chrome/Safari) - Thumb */
input[type="range"]::-webkit-slider-thumb,
.form-range::-webkit-slider-thumb,
.form-wrapper input[type="range"]::-webkit-slider-thumb,
.form-steps input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 3px solid #b5121b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-top: -11px !important;
    position: relative !important;
}

input[type="range"]::-webkit-slider-thumb:hover,
.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3) !important;
}

input[type="range"]::-webkit-slider-thumb:active,
.form-range::-webkit-slider-thumb:active {
    transform: scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* WebKit - Track */
input[type="range"]::-webkit-slider-runnable-track,
.form-range::-webkit-slider-runnable-track,
.form-wrapper input[type="range"]::-webkit-slider-runnable-track,
.form-steps input[type="range"]::-webkit-slider-runnable-track {
    width: 100% !important;
    height: 6px !important;
    min-height: 6px !important;
    max-height: 6px !important;
    background: transparent !important;
    border-radius: 3px !important;
    border: none !important;
    padding: 0 !important;
}

/* Firefox - Thumb */
input[type="range"]::-moz-range-thumb,
.form-range::-moz-range-thumb,
.form-wrapper input[type="range"]::-moz-range-thumb,
.form-steps input[type="range"]::-moz-range-thumb {
    -moz-appearance: none !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 3px solid #b5121b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

input[type="range"]::-moz-range-thumb:hover,
.form-range::-moz-range-thumb:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3) !important;
}

input[type="range"]::-moz-range-thumb:active,
.form-range::-moz-range-thumb:active {
    transform: scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* Firefox - Track */
input[type="range"]::-moz-range-track,
.form-range::-moz-range-track,
.form-wrapper input[type="range"]::-moz-range-track,
.form-steps input[type="range"]::-moz-range-track {
    width: 100% !important;
    height: 6px !important;
    min-height: 6px !important;
    max-height: 6px !important;
    background: transparent !important;
    border-radius: 3px !important;
    border: none !important;
    padding: 0 !important;
}

/* Firefox - Progress fill */
input[type="range"]::-moz-range-progress,
.form-range::-moz-range-progress {
    background: #b5121b !important;
    height: 6px !important;
    border-radius: 3px !important;
}

/* IE/Edge - Thumb */
input[type="range"]::-ms-thumb,
.form-range::-ms-thumb {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 3px solid #b5121b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer !important;
    margin-top: 0 !important;
}

/* IE/Edge - Track */
input[type="range"]::-ms-track,
.form-range::-ms-track {
    width: 100% !important;
    height: 6px !important;
    background: transparent !important;
    border-color: transparent !important;
    color: transparent !important;
    border-radius: 3px !important;
}

input[type="range"]::-ms-fill-lower,
.form-range::-ms-fill-lower {
    background: #b5121b !important;
    border-radius: 3px !important;
}

input[type="range"]::-ms-fill-upper,
.form-range::-ms-fill-upper {
    background: #e5e7eb !important;
    border-radius: 3px !important;
}

/* Value label styling */
.range-label {
    display: block !important;
    text-align: center !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #161928 !important;
    margin-bottom: 0.4rem !important;
}

/* Remove any padding/margin Bootstrap might add */
.form-wrapper .form-range,
.form-steps .form-range,
.form-wrapper input[type="range"],
.form-steps input[type="range"] {
    padding: 0 !important;
    margin: 1.25rem 0 1rem 0 !important;
}

/* ================================
   RANGE BUTTON + SLIDER SYSTEM
   ================================ */

/* Range Button Grid */
.value-range-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    justify-items: stretch;
}

/* Individual range button sizing */
.range-btn {
    background: var(--white);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    padding: 16px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #161928;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    box-shadow: var(--shadow-sm);
    width: 100%;
    min-height: var(--touch-target-comfortable);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Desktop hover states for range-btn */
@media (hover: hover) and (pointer: fine) {
    .range-btn:hover {
        border-color: var(--primary-color);
        background: rgba(22, 25, 40, 0.05);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

/* Touch active states for range-btn */
@media (hover: none) and (pointer: coarse) {
    .range-btn:active {
        border-color: var(--primary-color);
        background: rgba(181, 18, 27, 0.1);
        transform: scale(0.98);
    }
}

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

.range-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* Slider Container */
.slider-container {
    background: rgba(181, 18, 27, 0.05);
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 20px;
    animation: slideDown 0.3s ease-out;
}

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

/* Value Display */
.slider-value-display {
    margin-bottom: 16px;
}

.display-value {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

/* Custom Range Slider Styling */
.value-slider {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #e0e0e0 0%, #e0e0e0 100%);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    margin: 12px 0;
    touch-action: pan-x;
}

.value-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-fast);
}

.value-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.value-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-fast);
}

.value-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Slider Labels */
.slider-labels {
    font-size: 0.875rem;
    margin-top: 8px;
}

/* ================================
   BUTTONS - ENHANCED
   ================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    min-height: var(--touch-target-comfortable);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.back-btn { 
    background: var(--white);
    color: #161928;
    border: 2px solid #e0e0e0;
    box-shadow: var(--shadow-sm);
}

/* Desktop hover states for back-btn */
@media (hover: hover) and (pointer: fine) {
    .back-btn:hover { 
        background: #fafafa;
        border-color: var(--primary-light);
        color: var(--primary-color);
        transform: translateX(-4px); 
    }
}

/* Touch active states for back-btn */
@media (hover: none) and (pointer: coarse) {
    .back-btn:active { 
        background: #f5f5f5;
        border-color: var(--primary-color);
        transform: scale(0.98); 
    }
}

.next-btn, 
.submit-btn,
.btn-primary { 
    background: var(--gradient-accent);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    margin-left: auto;
    position: relative;
    overflow: hidden;
}

.next-btn::before,
.submit-btn::before,
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

/* Desktop hover states for next-btn/submit-btn */
@media (hover: hover) and (pointer: fine) {
    .next-btn:hover::before,
    .submit-btn:hover::before,
    .btn-primary:hover::before {
        left: 100%;
    }
    
    .next-btn:hover, 
    .submit-btn:hover:not(:disabled),
    .btn-primary:hover { 
        transform: translateY(-2px); 
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
        color: var(--white); 
    }
}

/* Touch active states for next-btn/submit-btn */
@media (hover: none) and (pointer: coarse) {
    .next-btn:active, 
    .submit-btn:active:not(:disabled),
    .btn-primary:active { 
        transform: scale(0.98); 
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    }
}

.btn-success {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.btn.invisible { 
    visibility: hidden; 
}

#submit-btn { 
    background: linear-gradient(135deg, #b5121b 0%, #d42833 100%) !important; 
    padding: 1rem 2.5rem; 
    border-radius: 14px; 
    font-size: 1.1rem; 
    width: auto; 
    margin: 0 auto; 
    display: inline-flex;
    color: #ffffff !important;
    border: none !important;
}

#submit-btn:disabled { 
    opacity: 0.6; 
    cursor: not-allowed; 
}

.icon-forward, 
.icon-back { 
    width: 1em; 
    height: 1em; 
}

/* Navigation Buttons */
.form-nav-buttons { 
    display: flex; 
    gap: 1rem; 
    margin-top: 2rem; 
    justify-content: space-between; 
}

/* ================================
   VALIDATION & MESSAGES
   ================================ */

label.error {
    color: #dc3545; 
    font-size: 0.875rem; 
    margin-top: 0.25rem; 
    display: block; 
    animation: shake 0.3s;
}

@keyframes shake { 
    0%,100% { transform: translateX(0);} 
    25% { transform: translateX(-5px);} 
    75% { transform: translateX(5px);} 
}

/* Address Search Components */
.manual-addres-wrapper { 
    display: none; 
    margin-top: 1rem; 
}

.addressSearch, 
.manualSearch { 
    font-size: 0.9rem; 
    color: var(--text-light); 
    margin-top: 1rem; 
}

.addressSearch { 
    display: none; 
}

.addressSearch a, 
.manualSearch a { 
    color: var(--accent-color); 
    text-decoration: underline; 
    cursor: pointer; 
    transition: all var(--transition-base); 
}

.addressSearch a:hover, 
.manualSearch a:hover { 
    color: var(--accent-dark); 
}

/* ================================
   POOR CREDIT OFFER POPUP STYLES
   ================================ */

#step-poor-credit { 
    display: none; 
}

.ty-offer-container {
    border: 3px solid #b5121b;
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, rgba(181, 18, 27, 0.05) 0%, rgba(212, 40, 51, 0.05) 100%);
    transition: all 0.3s ease;
}

.ty-offer-container:hover {
    box-shadow: 0 8px 32px rgba(181, 18, 27, 0.2);
    transform: translateY(-2px);
    border-color: #161928;
}

.ty-offer-container ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.ty-offer-container ul li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 0.5rem;
}

.ty-offer-container ul li::marker {
    color: #b5121b;
    font-weight: bold;
}

/* ================================
   LOADING SPINNER
   ================================ */

.spinner-border { 
    width: 1rem; 
    height: 1rem; 
    border-width: 2px; 
}

#dynamic-loader {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    height: 100dvh; 
    background: rgba(255, 255, 255, 0.9);
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 2000;
}

#dynamic-loader .spinner-border { 
    width: 3rem; 
    height: 3rem; 
    border-width: 4px; 
    color: var(--accent-color); 
}

/* ================================
   ZIPCODE LABEL
   ================================ */

.zipcode-label {
    display: inline-block; 
    font-weight: 600; 
    color: #b5121b;
    padding: 0.25rem 0.5rem; 
    background: rgba(181, 18, 27, 0.1) !important; 
    border-radius: 6px;
}

/* ================================
   PARTNERS SECTION
   ================================ */

.section-partners {
    background: var(--white); 
    padding: 3rem 0; 
    border-top: 1px solid #e0e0e0; 
    border-bottom: 1px solid #e0e0e0; 
    overflow: hidden;
}

.partners-text { 
    font-size: 0.875rem; 
    font-weight: 700; 
    letter-spacing: 0.1em; 
    color: var(--text-light); 
    margin-bottom: 2rem; 
}

.partners-container { 
    overflow: hidden; 
    position: relative; 
}

.partners { 
    display: flex; 
    animation: scroll 30s linear infinite; 
    width: fit-content; 
}

.partner { 
    flex-shrink: 0; 
    padding: 0 3rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.partner img { 
    opacity: 0.6; 
    filter: grayscale(100%); 
    transition: all var(--transition-base); 
}

.partner:hover img { 
    opacity: 1; 
    filter: grayscale(0%); 
}

@keyframes scroll { 
    0% { transform: translateX(0);} 
    100% { transform: translateX(-50%);} 
}

/* ================================
   FEATURES SECTION
   ================================ */

.features { 
    padding: 6rem 0; 
    background: var(--white); 
}

.features-title { 
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ================================
   FOOTER STYLES
   ================================ */

.footer-modern {
    background: #161928;
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem 0 1.5rem 0;
    flex-shrink: 0;
    margin-top: auto;
    padding-bottom: calc(1.5rem + var(--safe-area-bottom));
}

.footer-trust-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.trust-item svg {
    color: var(--accent-color);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.trust-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-links {
    padding: 1.5rem 0;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
}

.footer-link:hover {
    color: var(--white);
}

.footer-separator {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 0.75rem;
}

.footer-copyright p,
.copyright p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.footer-disclaimer p,
.disclosure-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}

footer {
    z-index: 999 !important;
}

/* ================================
   CHAT BOX STYLES
   ================================ */

.chat-box {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    background: var(--white);
    padding-bottom: 3rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.chat-box-heading {
    padding: 1.5rem 2rem;
    background: var(--gradient-primary);
    color: var(--white);
}

.chat-box-title {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.chat-box-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(0.95rem, 3vw, 1.125rem);
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
}

.chat-box-date {
    text-align: center;
    padding: 1rem;
    color: var(--text-medium);
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-box-body {
    padding: 1.5rem 2rem;
}

/* Messages */
.agent-message {
    background-color: #f8f9fa;
    padding: 20px 25px;
    border-radius: var(--radius-xl);
    border-top-left-radius: 0;
    margin-bottom: 25px;
    color: #161928;
    max-width: 620px;
    width: auto;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.user-message {
    background: linear-gradient(135deg, rgba(181, 18, 27, 0.15) 0%, rgba(212, 40, 51, 0.15) 100%);
    padding: 20px 25px;
    border-radius: var(--radius-xl);
    border-top-right-radius: 0;
    margin-bottom: 15px;
    color: #161928;
    max-width: 620px;
    width: auto;
    display: block;
    line-height: 1.6;
    border: 2px solid #b5121b;
}

.chat-box-agent-reply {
    display: flex;
}

.agent-profile {
    margin-right: 15px;
    flex-shrink: 0;
}

.chat-box-user-reply {
    display: flex;
    justify-content: flex-end;
    display: none;
}

.user-reply {
    display: flex;
    flex-direction: column;
}

/* Textarea */
#user-textarea {
    width: 100%;
    padding: 1.5rem 1rem;
    height: 100%;
    border-radius: 0;
    min-height: 78px;
    padding-right: 50px;
    border: none;
    font-family: inherit;
    font-size: 16px; /* Prevents iOS zoom */
}

.textarea-wrapper {
    margin-top: 1rem;
    padding: 0;
}

.textbox-form {
    position: relative;
    width: 100%;
    border: 2px solid #e0e0e0;
    padding-right: 50px;
    border-radius: var(--radius-md);
    transition: border-color 0.3s ease;
}

.textbox-form:focus-within {
    border-color: #b5121b;
}

#user-send {
    position: absolute;
    border: none;
    background-color: transparent;
    padding: 0 0 0 15px;
    top: 16px;
    right: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}

.send-btn-icon {
    color: #b5121b;
    font-size: 24px;
}

#user-textarea:focus::placeholder {
    color: transparent;
}

#user-textarea:focus {
    box-shadow: none;
    border: none;
    outline: none;
}

#user-send:hover .send-btn-icon {
    color: #161928;
    transform: scale(1.1);
}

/* Scrollbar Styles */
#user-textarea::-webkit-scrollbar-track {
    box-shadow: inset 0 0 6px rgba(0,0,0,0.05);
    border-radius: 0;
    background-color: #ffffff;
}

#user-textarea::-webkit-scrollbar {
    width: 5px;
    background-color: #F5F5F5;
}

#user-textarea::-webkit-scrollbar-thumb {
    border-radius: 5px;
    box-shadow: inset 0 0 6px rgba(0,0,0,.15);
    background-color: #b5121b;
}

/* ================================
   UTILITY CLASSES
   ================================ */

.clickable { 
    cursor: pointer; 
}

.d-none { 
    display: none !important; 
}

.text-center { 
    text-align: center; 
}

.fw-bold { 
    font-weight: 700; 
}

.fw-medium { 
    font-weight: 500; 
}

/* ================================
   MODAL STYLES
   ================================ */

/* Header should be below modal backdrop */
header {
    position: sticky;
    top: 0;
    z-index: 1000 !important;
}

/* Hide the backdrop completely for mortgage specialist modal */
.modal-backdrop {
    display: none !important;
}

/* Modal should be above everything */
.modal {
    z-index: 1055 !important;
}

/* Mortgage Specialist Modal - Specific Styling */
#mortgageSpecialistModal {
    background: rgba(0, 0, 0, 0) !important;
}

#mortgageSpecialistModal .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
}

#mortgageSpecialistModal .modal-content {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

#mortgageSpecialistModal .modal-body {
    padding: 2rem;
}

#mortgageSpecialistModal .btn {
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
    z-index: 9999;
}

#mortgageSpecialistModal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

#mortgageSpecialistModal .btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background: #fff;
}

#mortgageSpecialistModal .btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
}

.modal-dialog {
    z-index: 1060 !important;
    margin: 1rem;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
}

.modal-content {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
}

/* ================================
   MOBILE RESPONSIVENESS
   ================================ */

/* Large Tablets */
@media (max-width: 992px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .form-steps legend.questions,
    .form-steps h3 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .form-wrapper {
        padding: 1.75rem 1.5rem 2rem 1.5rem;
    }
    
    .form-nav-buttons {
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    #submit-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .form-control, .form-control-lg,
    .form-select, .form-select-lg {
        font-size: 16px;
        padding: 0.75rem 0.875rem;
    }
    
    .partner {
        padding: 0 2rem;
    }
    
    .progress {
        height: 12px;
    }
    
    .value-range-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 100%;
    }
    
    .range-btn {
        padding: 14px 10px;
        font-size: 0.875rem;
    }
    
    .display-value {
        font-size: 1.75rem;
    }
    
    .slider-container {
        padding: 18px;
    }
}

/* Mobile Devices */
@media (max-width: 767px) {
    :root {
        --touch-target-min: 48px;
        --touch-target-comfortable: 52px;
    }
    
    .logo {
        max-height: 50px;
    }
    
    header .container {
        padding: 0.75rem 1rem;
    }
    
    .section-main {
        padding: 1rem 0 1.5rem 0;
    }
    
    .wrapper-narrow-maxwidth {
        padding: 0 0.75rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .form-steps legend.questions,
    .form-steps h3 {
        font-size: 1.35rem;
        line-height: 1.3;
        margin-bottom: 1.25rem;
    }
    
    .form-steps p {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }
    
    .form-wrapper {
        padding: 1.5rem 1rem 1.75rem 1rem;
        border-radius: var(--radius-lg);
    }
    
    .progress {
        height: 12px;
    }
    
    .progress-percentage {
        font-size: 0.7rem;
    }
    
    .input-field-wrapper {
        margin-bottom: 0.875rem;
    }
    
    .form-control, .form-control-lg,
    .form-select, .form-select-lg {
        font-size: 16px;
        padding: 0.875rem;
        border-radius: 10px;
        min-height: var(--touch-target-min);
    }
    
    .form-label {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }
    
    .form-check-label {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        min-height: var(--touch-target-comfortable);
        word-break: break-word;
    }
    
    .row .col-md-6.mb-2,
    .row .col-md-4.mb-2 {
        margin-bottom: 0.75rem !important;
    }
    
    .form-nav-buttons {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.95rem 1.75rem;
        font-size: 1rem;
        border-radius: 10px;
        min-height: var(--touch-target-comfortable);
    }
    
    .back-btn {
        flex: 0 0 auto;
        min-width: 100%;
    }
    
    .next-btn, .submit-btn {
        flex: 1;
        min-width: 100%;
    }
    
    #submit-btn {
        padding: 0.95rem 1.75rem;
        font-size: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .icon-forward, .icon-back {
        width: 0.9em;
        height: 0.9em;
    }
    
    .select-box {
        padding: 0.875rem 0.75rem;
        min-height: 100px;
    }
    
    .select-label-option {
        min-height: 100px;
        padding: 1rem 0.75rem;
    }
    
    .select-img {
        width: 44px;
        height: 44px;
        max-width: 44px;
        max-height: 44px;
    }
    
    .box-option-title {
        font-size: 0.95rem;
    }
    
    .box-option-title small {
        font-size: 0.8rem;
    }
    
    .range-label {
        font-size: 1.25rem !important;
    }
    
    .value-range-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .range-btn {
        padding: 14px 8px;
        font-size: 0.85rem;
        min-height: var(--touch-target-comfortable);
    }
    
    .features {
        padding: 3rem 0;
    }
    
    .feature-card {
        padding: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .footer-modern {
        padding: 1.5rem 0 1rem 0;
        padding-bottom: calc(1rem + var(--safe-area-bottom));
    }
    
    .footer-trust-section {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    .trust-item {
        padding: 0.6rem 1rem;
        gap: 0.6rem;
    }
    
    .trust-item svg {
        width: 20px;
        height: 20px;
    }
    
    .trust-item span {
        font-size: 0.85rem;
    }
    
    .footer-links {
        padding: 1rem 0;
    }
    
    .footer-link {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }
    
    .footer-separator {
        display: none;
    }
    
    .footer-links .list-inline-item {
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .footer-copyright p,
    .copyright p {
        font-size: 0.8rem;
    }
    
    .footer-disclaimer p,
    .disclosure-text {
        font-size: 0.75rem;
    }
    
    .chat-box-heading {
        padding: 1.25rem 1rem;
    }
    
    .chat-box-body {
        padding: 1rem 0.75rem;
    }
    
    .agent-message,
    .user-message {
        padding: 15px 18px;
        font-size: 0.95rem;
        max-width: 90%;
    }
    
    #user-textarea {
        font-size: 16px;
        padding: 1rem 0.75rem;
        min-height: 70px;
    }
    
    .ty-offer-container {
        padding: 1.5rem 1rem;
        border-radius: var(--radius-md);
    }
    
    /* Slider thumb larger on mobile */
    input[type="range"]::-webkit-slider-thumb,
    .form-range::-webkit-slider-thumb {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        margin-top: -13px !important;
    }
    
    input[type="range"]::-moz-range-thumb,
    .form-range::-moz-range-thumb {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    .slider-container {
        padding: 16px;
    }
    
    .display-value {
        font-size: 1.5rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .form-steps legend.questions,
    .form-steps h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .form-wrapper {
        padding: 1.25rem 0.875rem 1.5rem 0.875rem;
    }
    
    .form-check-label {
        font-size: 0.9rem;
        padding: 0.75rem 0.875rem;
        min-height: var(--touch-target-min);
    }
    
    .row .col-md-4.mb-2,
    .row .col-lg-3.mb-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .btn {
        font-size: 0.95rem;
        padding: 0.875rem 1.25rem;
    }
    
    .back-btn span,
    .next-btn span {
        font-size: 0.95rem;
    }
    
    .select-box {
        min-height: 90px;
        padding: 0.75rem 0.5rem;
    }
    
    .select-label-option {
        min-height: 90px;
        padding: 0.875rem 0.5rem;
    }
    
    .select-img {
        width: 40px;
        height: 40px;
        max-width: 40px;
        max-height: 40px;
    }
    
    .box-option-title {
        font-size: 0.875rem;
    }
    
    .value-range-buttons {
        gap: 6px;
    }
    
    .range-btn {
        padding: 12px 6px;
        font-size: 0.8rem;
    }
}

/* Landscape orientation fix for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .form-wrapper {
        margin: 0.5rem auto;
        padding: 1rem;
    }
    
    .form-steps legend.questions,
    .form-steps h3 {
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
    
    .form-steps p {
        margin-bottom: 0.5rem;
    }
    
    .input-field-wrapper {
        margin-bottom: 0.5rem;
    }
    
    .form-nav-buttons {
        flex-direction: row;
        margin-top: 1rem;
    }
    
    .btn {
        width: auto;
        flex: 0 0 auto;
    }
}

/* Ensure touch targets are at least 44x44px */
@media (max-width: 768px) {
    button, 
    .btn,
    .form-check-label,
    .form-select,
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="date"],
    a.footer-link {
        min-height: 44px;
    }
}

/* Fix viewport units on mobile browsers */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    
    .section-main {
        min-height: -webkit-fill-available;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .form-wrapper {
        border: 0.5px solid rgba(0, 0, 0, 0.08);
    }
}

/* Smooth Entrance Animations */
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(20px);} 
    to { opacity: 1; transform: translateY(0);} 
}

[data-aos] { 
    animation: fadeIn 0.8s ease-out; 
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .progress-bar::before {
        animation: none;
    }
    
    .partners {
        animation: none;
    }
}