/* static/css/style.css */

/* ─── CSS Variables for Corporate Colors ──────────────────────────────────── */
:root {
    /* Corporate Colors - DO NOT CHANGE */
    --primary-color: #2199E8;
    --secondary-color: #F57F30;
    --purple-color: #880A51;
    --burgundy-color: #880A51;
    --dark-color: #21212D;
    --green-color: #ACBD31;
    --navy-color: #001f3f;
    
    /* Theme Colors */
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #95a5a6;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --border-color: #dee2e6;
    --border-focus: var(--primary-color);
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.2);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-round: 50%;
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    font-size: 1.2rem; /* Increased base font size by 20% */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Mobile body font increase */
@media (max-width: 600px) {
    body {
        font-size: 1.3rem; /* Further increase for mobile */
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent table and code block overflow */
table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

pre {
    max-width: 100%;
    overflow-x: auto;
}

/* ─── Container - FORCED DESKTOP WIDTH LIMIT ─────────────────────────────────── */
.container {
    width: 100%;
    max-width: 900px !important; /* Force max width */
    margin: 2rem auto;
    padding: 3rem;
    background-color: #ffffff;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    position: relative;
    min-height: 600px;
    overflow-x: hidden;
}

/* Additional desktop width enforcement */
@media (min-width: 769px) {
    .container {
        width: 900px !important;
        max-width: 900px !important;
    }
}

/* Ensure no child element can overflow */
.container * {
    max-width: 100%;
}

/* Global overflow prevention */
body > * {
    overflow-x: hidden;
}

/* Prevent any fixed width elements from causing overflow */
* {
    max-width: 100vw !important;
}

@media (max-width: 768px) {
    * {
        max-width: 100vw !important;
    }
}

/* Form Container */
#searchForm {
    width: 100%;
    overflow-x: hidden;
}

/* Form Steps Container - Full width within container */
.form-steps-container {
    width: 100%;
    margin-top: 2rem;
    overflow-x: hidden;
}

@media (max-width: 600px) {
    .form-steps-container {
        margin-top: 1rem;
    }
}

/* Progress bar with uniform spacing on desktop */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto 3rem;
    padding: 2rem 1rem;
    background: transparent;
    position: relative;
    width: 100%;
    max-width: 100%;
}

/* Progress step with flex-basis for uniform spacing */
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 150px;
}

/* Connector lines between steps */
.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    width: calc(100% - 48px);
    height: 2px;
    background: #e9ecef;
    left: calc(50% + 24px);
    top: 24px;
    z-index: 1;
}

.progress-step.completed:not(:last-child)::after {
    background: #28a745;
}

/* Form steps - Full width within container */
.form-step {
    display: none;
    animation: fadeIn var(--transition-base);
    min-height: 400px;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Ensure form steps are visible when active */
.form-step.active {
    display: block !important;
}

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

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    .container {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
        border-radius: 12px;
        min-height: 500px;
        max-width: calc(100vw - 1rem); /* Reduced from 2rem to ensure full visibility */
        width: calc(100vw - 1rem);
    }
    
    .form-step {
        max-width: 100%;
    }
}

/* Step number circle */
.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    transition: all var(--transition-base);
    border: 3px solid transparent;
}

.step-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
    transition: all var(--transition-base);
    white-space: normal;
    max-width: 100px;
    line-height: 1.2;
    margin-top: 0.25rem;
    /* EQUAL HEIGHT FOR MOBILE */
    min-height: 2.4em; /* Ensures consistent height for 2 lines */
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-step.active .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(33, 153, 232, 0.1);
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.completed .step-number {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.progress-step.completed .step-label {
    color: #28a745;
}

/* Mobile Progress Bar - FIXED CENTERING AND VISIBILITY */
@media (max-width: 768px) {
    .progress-bar {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        grid-template-rows: repeat(2, auto) !important;
        gap: 1rem 0.5rem !important;
        padding: 1rem 0.5rem !important;
        margin-bottom: 2rem !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-items: center !important;
        align-items: center !important;
        overflow-x: visible !important;
    }
    
    .progress-step {
        flex: unset !important;
        min-width: unset !important;
        gap: 0.25rem !important;
        justify-self: center !important;
        max-width: unset !important;
        width: 100% !important;
        /* FORCE EQUAL HEIGHTS */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        height: 100px !important; /* Fixed height for consistency */
    }
    
    /* Hide connector lines on mobile */
    .progress-step:not(:last-child)::after {
        display: none !important;
    }
    
    .step-number {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
        flex-shrink: 0 !important;
    }
    
    .step-label {
        font-size: 0.65rem !important;
        max-width: 70px !important;
        white-space: normal !important;
        line-height: 1.1 !important;
        text-align: center !important;
        /* EQUAL HEIGHT AND CENTERING */
        min-height: 3em !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 !important;
        padding: 0 2px !important;
    }
}

/* ─── Welcome Screen (Step 0) ──────────────────────────────────────────────── */
.welcome-container {
    text-align: center;
    padding: 2rem 0;
    max-width: 100%;
}

.welcome-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--burgundy-color);
    margin-bottom: 3rem;
    line-height: 1.3;
}

.welcome-benefits {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--bg-tertiary);
    transition: all var(--transition-base);
    text-align: left;
}

.benefit-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.benefit-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.benefit-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.benefit-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.benefit-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.welcome-button-container {
    margin-top: 3rem;
}

.welcome-footer {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* NEW: Hide step preview on mobile for step 0 */
.step-preview-mobile {
    display: none;
}

/* Hide any step-related content on mobile for step 0 */
@media (max-width: 600px) {
    #step0 .step-preview-mobile,
    #step0 .progress-step,
    #step0 .step-number,
    #step0 .step-label {
        display: none !important;
    }
}

/* Page Footer - Common across all pages */
.page-footer {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-disclaimer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    max-width: 500px;
    margin: 0;
    padding: 0 1rem;
    font-style: italic;
    text-align: center;
}

.trust-logo {
    width: 360px;
    height: auto;
    opacity: 0.8;
    transition: opacity var(--transition-base);
}

.trust-logo:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .welcome-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    
    .welcome-benefits {
        gap: 1.25rem;
        margin-bottom: 2.5rem;
    }
    
    .benefit-item {
        padding: 1rem;
        gap: 1rem;
    }
    
    .benefit-icon {
        width: 32px;
        height: 32px;
    }
    
    .benefit-title {
        font-size: 1.125rem;
    }
    
    .benefit-subtext {
        font-size: 0.8rem;
    }
    
    .welcome-footer {
        margin-top: 2rem;
        gap: 1rem;
    }
    
    .page-footer {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .footer-disclaimer {
        font-size: 0.75rem;
    }
    
    .trust-logo {
        width: 300px;
        max-width: 90vw;
    }
}

/* ─── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.section-heading {
    color: var(--burgundy-color);
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.step-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--burgundy-color);
    margin-bottom: 0.5rem;
}

.step-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

#step5 .step-subtitle {
    margin-bottom: 1.5rem;
}

.step-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

@media (max-width: 600px) {
    .section-heading {
        font-size: 1.5rem;
    }
    
    .step-title {
        font-size: 1.375rem;
    }
    
    .step-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
}

/* ─── Form Sections ────────────────────────────────────────────────────────── */
.form-section {
    margin-bottom: 2rem;
    width: 100%;
    overflow-x: hidden;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.required {
    color: var(--error-color);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    background-color: var(--bg-primary);
    font-family: inherit;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.form-input:hover,
.form-select:hover {
    border-color: #adb5bd;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(33, 153, 232, 0.1);
    background-color: var(--bg-primary);
}

.form-input-large {
    font-size: 1.25rem;
    padding: 1rem 1.25rem;
}

/* Mobile form inputs */
@media (max-width: 600px) {
    .form-input,
    .form-select {
        padding: 0.75rem 0.875rem;
        font-size: 1.2rem;
    }
}

/* ─── Title Button Group - Grid layout for perfect alignment ───────────────────────────────────────────────────── */
.title-button-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

.title-btn {
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 1rem;
    white-space: nowrap;
}

/* Make 'Other' button span 2 columns */
.title-btn-other {
    grid-column: 2 / 4;
}

@media (max-width: 600px) {
    .title-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

.title-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.title-btn.active {
    background-color: var(--dark-color);
    color: white;
    border-color: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ─── Date of Birth with FULL WIDTH Year Slider ──────────────────────────────────────── */
.dob-container {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr; /* 25% / 25% / 50% distribution */
    gap: 1rem;
    width: 100%;
}

@media (max-width: 600px) {
    .dob-container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

.year-input-group {
    position: relative;
    width: 100%; /* Full width of its container */
    display: flex;
    flex-direction: column;
}

.year-slider-container {
    margin-top: 0.5rem;
    width: 100%; /* Match input width */
}

.year-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.year-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.slider-tooltip.show {
    opacity: 1;
}

/* ─── Address Section ──────────────────────────────────────────────────────── */
.address-lookup-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    width: 100%;
    overflow-x: hidden;
}

.postcode-lookup {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50/50 split */
    gap: 1rem;
}

@media (max-width: 600px) {
    .address-lookup-section {
        padding: 1.5rem;
    }
    
    .postcode-lookup {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
}

.address-select-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.manual-entry-toggle {
    text-align: center;
    margin-top: 1.5rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.btn-link:hover {
    color: var(--burgundy-color);
}

.address-fields {
    animation: slideDown var(--transition-base);
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.flex-2 {
    grid-column: span 2;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    padding: 0.875rem 2rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon {
    font-size: 1.25rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1a7bc4;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #e06f20;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.button-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 600px) {
    .button-row {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
        max-width: 100%;
    }
}

/* ─── Verification Cards ───────────────────────────────────────────────────── */
.verification-card {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 600px) {
    .verification-card {
        padding: 1.5rem;
    }
}

.otp-input {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.5rem;
    font-weight: 600;
    width: 100%;
    padding-right: 0.5rem; /* Account for last letter spacing */
}

@media (max-width: 600px) {
    .otp-input {
        font-size: 1.8rem;
        letter-spacing: 0.4rem;
        padding-right: 0.4rem;
    }
}

.resend-container {
    margin-top: 1rem;
}

/* ─── Identity Check Card ──────────────────────────────────────────────────── */
.identity-check-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, white 100%);
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 600px) {
    .identity-check-card {
        padding: 2rem;
    }
}

.check-info {
    margin-bottom: 2rem;
}

.check-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.identity-status {
    margin-top: 2rem;
    padding: 2rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.status-content h4 {
    margin-bottom: 0.5rem;
}

.score-display {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.score-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ─── Review Card ──────────────────────────────────────────────────────────── */
.review-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 600px) {
    .review-card {
        padding: 1.5rem;
    }
}

.review-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
    flex-shrink: 0;
}

.review-value {
    color: var(--text-primary);
    text-align: right;
    flex: 1;
}

/* ─── Consent Section ──────────────────────────────────────────────────────── */
.consent-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    width: 100%;
    overflow-x: hidden;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-container input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.checkbox-label {
    flex: 1;
    color: var(--text-primary);
    word-wrap: break-word;
}

@media (max-width: 600px) {
    .consent-section {
        padding: 0.75rem;
    }
    
    .checkbox-container {
        gap: 0.5rem;
    }
    
    .checkbox-label {
        font-size: 1.1rem;
        line-height: 1.5;
    }
}

/* ─── Lenders List - IMPROVED 50/50 SPLIT LAYOUT ─────────────────────────────────────────── */
.lenders-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns on desktop */
    gap: 1rem;
    width: 100%;
    overflow-x: hidden;
}

/* Mobile: 1 lender per row for steps 5 and 6 */
@media (max-width: 768px) {
    .lenders-list,
    #step5 .lenders-list,
    #step6 .lenders-list,
    #final_lenders_list,
    #combined_lenders_list {
        grid-template-columns: 1fr !important; /* Single column on mobile */
    }
}

.found-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* EXACT 50/50 split */
    gap: 0;
    align-items: center;
    padding: 1rem;
    border: 3px solid var(--green-color);
    border-radius: var(--radius-lg);
    background-color: white;
    transition: all var(--transition-base);
    min-height: 100px; /* Consistent minimum height */
}

.found-row:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Left side - Logo/Name container */
.lender-icon {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;
    padding-right: 1rem;
    height: 80px; /* Fixed height for consistency */
}

/* Logo styling - force fit */
.lender-logo {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.no-logo {
    background-color: var(--navy-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: bold;
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

/* Right side - Date container */
.lender-date {
    text-align: right;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    padding-left: 1rem;
}

/* Name column - only used when no logo */
.lender-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.125rem;
    text-align: left;
    display: none; /* Hidden by default, JS will show if needed */
}

@media (max-width: 600px) {
    .found-row {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .lender-icon {
        justify-content: center;
        padding-right: 0;
    }
    
    .lender-date {
        text-align: center;
        padding-left: 0;
    }
    
    .lender-name {
        text-align: center;
    }
}

/* ─── Additional Actions ───────────────────────────────────────────────────── */
.additional-actions {
    margin-top: 2rem;
    text-align: center;
}

.info-note {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    width: 100%;
    overflow-x: hidden;
}

.info-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.info-note p {
    flex: 1;
    color: #1565c0;
    margin: 0;
    word-wrap: break-word;
}

@media (max-width: 600px) {
    .info-note {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .info-icon {
        font-size: 1.25rem;
    }
}

/* ─── Combined Lenders Display ───────────────────────────────────────────────── */
.combined-lenders-section {
    margin-top: 3rem;
    padding: 0; /* Removed background */
}

.combined-lenders-section h3 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

/* Manual lender row styling */
.manual-row {
    border-color: var(--primary-color) !important;
    background-color: #f0f8ff;
}

.manual-row .lender-date {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-style: italic;
}

/* ─── Final Lenders Summary ───────────────────────────────────────────────── */
.final-lenders-summary {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.final-lenders-summary h3 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

/* ─── FCA Claims Section ──────────────────────────────────────────────────── */
.fca-claims-section {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.fca-claims-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.fca-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.claim-type-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.claim-type-item .checkbox-label {
    line-height: 1.6;
}

.claim-type-item .checkbox-label strong {
    color: var(--text-primary);
    font-size: 1.05rem;
}

/* ─── Terms and Signature Section ─────────────────────────────────────────── */
.terms-signature-section {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.terms-acceptance {
    margin-bottom: 2rem;
}

.terms-acceptance a {
    color: var(--primary-color);
    text-decoration: underline;
}

.terms-acceptance a:hover {
    color: var(--burgundy-color);
}

.fee-info {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.fee-info p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.fee-info p:last-child {
    margin-bottom: 0;
}

.fee-details {
    font-weight: 600;
    color: var(--text-primary) !important;
}

/* ─── Signature Section ───────────────────────────────────────────────────── */
.signature-section {
    margin-bottom: 2rem;
}

.signature-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.signature-box {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    padding: 1rem;
}

#signature_canvas {
    width: 100%;
    height: 150px;
    border: 2px solid #adb5bd;
    border-radius: var(--radius-sm);
    cursor: crosshair;
    touch-action: none;
    background-color: #fcfcfc;
    display: block;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    transition: border-color var(--transition-base);
}

#signature_canvas:hover {
    border-color: var(--primary-color);
}

.signature-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

/* Desktop: Show both buttons */
@media (min-width: 601px) {
    .signature-hint {
        font-size: 0.9rem;
        color: var(--text-secondary);
        margin-top: 0.5rem;
        text-align: center;
    }
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Auto-Sign button special styling */
#auto_sign {
    background-color: var(--burgundy-color);
    color: white;
    font-weight: bold;
}

#auto_sign:hover {
    background-color: #6d0840;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.final-submit-container {
    text-align: center;
    margin-top: 2rem;
}

/* Small button row adjustment for step 5 */
#add_more_lenders_btn {
    background-color: var(--primary-color) !important;
}

/* Step 5 button row with info note below */
.step5-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (max-width: 600px) {
    .fca-claims-section,
    .terms-signature-section,
    .final-lenders-summary {
        padding: 1.5rem;
    }
    
    .signature-controls {
        flex-direction: column;
    }
    
    .btn-small {
        width: 100%;
    }
}

/* ─── Final Submit Card ────────────────────────────────────────────────────── */
.final-submit-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, white 100%);
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 600px) {
    .final-submit-card {
        padding: 2rem;
    }
}

.final-submit-card .check-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.final-submit-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.final-submit-card p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

/* Responsive button layout for step 5 */
@media (max-width: 768px) {
    #step5 .button-row {
        flex-direction: column-reverse; /* Stack vertically on mobile */
    }
    
    #step5 .button-row .btn {
        width: 100%;
    }
}

/* ─── Messages & Status ────────────────────────────────────────────────────── */
.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    animation: shake var(--transition-fast);
}

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

.info-message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    font-size: 0.95rem;
    text-align: center;
}

.info-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.info-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message {
    text-align: center;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* ─── Loading Overlay ──────────────────────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    overflow: hidden;
}

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

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
}

/* ─── Change Mobile Section ────────────────────────────────────────────────── */
.change-mobile-section {
    margin-top: 2rem;
}

/* ─── Results & Debug (Hidden from users) ──────────────────────────────────── */
.result-container,
.debug-container {
    display: none !important; /* Always hidden from users */
}

.status-container {
    display: none !important; /* Always hidden from users */
}

/* ─── Lender Selection Interface ───────────────────────────────────────────── */
.selected-lenders-section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.selected-lenders-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.selected-lenders-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 50px;
}

.selected-lender-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.selected-lender-chip button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    margin-left: 0.25rem;
}

.lender-search-section {
    margin-bottom: 2rem;
}

.lender-search-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.lender-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 153, 232, 0.1);
}

/* Lender Grid - IMPROVED WITH SMALLER MARGINS AND BIGGER LOGOS */
.lender-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Changed from 5 to 4 columns for bigger items */
    gap: 1rem; /* Reduced gap from 1.5rem */
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .lender-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem; /* Even smaller gap on mobile */
    }
}

.lender-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem; /* Reduced padding from 1rem */
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    background: white;
    text-align: center;
    min-height: 120px; /* Ensure consistent height */
}

.lender-grid-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.lender-grid-item.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.lender-grid-logo {
    width: 80px; /* Increased from 60px */
    height: 80px; /* Increased from 60px */
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.lender-grid-name {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    /* CENTER TEXT VERTICALLY AND HORIZONTALLY */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: 0.25rem;
}

.no-logo-placeholder {
    width: 80px; /* Increased from 60px */
    height: 80px; /* Increased from 60px */
    background: var(--navy-color);
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem; /* Slightly increased */
    margin-bottom: 0.5rem;
    text-align: center;
    padding: 0.5rem;
}

/* Submit Ready Card */
.submit-ready-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, white 100%);
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.submit-ready-card .check-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ─── Terms Modal ──────────────────────────────────────────────────────────── */
.terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    backdrop-filter: blur(8px);
}

.terms-modal-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terms-header {
    padding: 2rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.terms-header h2 {
    margin: 0;
    color: var(--burgundy-color);
    font-size: 1.75rem;
}

.terms-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.terms-content {
    line-height: 1.6;
    color: var(--text-primary);
}

.terms-content h3 {
    color: var(--burgundy-color);
    margin: 2rem 0 1rem;
    font-size: 1.25rem;
}

.terms-content p {
    margin-bottom: 1rem;
}

.terms-content ul {
    margin: 1rem 0 1rem 2rem;
}

.terms-content li {
    margin-bottom: 0.5rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-base);
}

.scroll-indicator.hidden {
    opacity: 0;
}

.scroll-message {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.terms-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.terms-accept-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.terms-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.terms-checkbox-wrapper input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

.terms-checkbox-wrapper label {
    font-weight: 600;
    color: var(--text-primary);
}

.terms-checkbox-wrapper.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.terms-checkbox-wrapper.disabled input,
.terms-checkbox-wrapper.disabled label {
    cursor: not-allowed;
}

.btn-close-terms {
    background: var(--primary-color);
}

.btn-close-terms:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .terms-modal-content {
        width: 95%;
        height: 95vh;
    }
    
    .terms-header {
        padding: 1.5rem;
    }
    
    .terms-body {
        padding: 1.5rem;
    }
    
    .terms-footer {
        padding: 1rem 1.5rem;
    }
    
    .terms-accept-container {
        flex-direction: column;
    }
    
    .btn-close-terms {
        width: 100%;
    }
}

/* ─── Utility Classes ──────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Desktop only elements */
.desktop-only {
    display: block;
}

@media (max-width: 600px) {
    .desktop-only {
        display: none;
    }
}

/* ─── Print Styles ─────────────────────────────────────────────────────────── */
@media print {
    .button-row,
    .progress-bar,
    .loading-overlay {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
        padding: 1rem;
    }
}

/* ─── Comprehensive Mobile Text Size Improvements (35% Increase) ────────────── */
@media (max-width: 600px) {
    /* Base text increases - 35% larger */
    p, .form-label, .review-label, .review-value {
        font-size: 1.35rem !important;
    }
    
    /* Reduce padding to compensate for larger text */
    .form-section {
        margin-bottom: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .review-card {
        padding: 1.25rem;
    }
    
    .review-item {
        padding: 0.75rem 0;
    }
    
    .verification-card {
        padding: 1.5rem;
    }
    
    .info-note {
        padding: 0.875rem;
    }
    
    .info-note p {
        font-size: 1.3rem !important;
    }
    
    .status-message {
        font-size: 1.35rem !important;
    }
    
    .error-message {
        font-size: 1.2rem !important;
    }
    
    .btn {
        font-size: 1.35rem !important;
        padding: 0.875rem 1.5rem;
    }
    
    .btn-large {
        font-size: 1.5rem !important;
        padding: 1rem 2rem;
    }
    
    .step-subtitle {
        font-size: 1.35rem !important;
    }
    
    .lender-date {
        font-size: 1.4rem !important;
    }
    
    /* Additional text elements */
    .checkbox-label {
        font-size: 1.3rem !important;
    }
    
    .title-btn {
        font-size: 1.2rem !important;
    }
    
    .form-input,
    .form-select {
        font-size: 1.35rem !important;
    }
    
    .step-label {
        font-size: 0.9rem !important;
    }
    
    .section-heading {
        font-size: 1.8rem !important;
    }
    
    .step-title {
        font-size: 1.6rem !important;
    }
    
    .benefit-title {
        font-size: 1.4rem !important;
    }
    
    .benefit-subtext {
        font-size: 1.1rem !important;
    }
    
    .footer-disclaimer {
        font-size: 1rem !important;
    }
    
    /* Fee info text */
    .fee-info p {
        font-size: 1.3rem !important;
    }
    
    /* Signature section */
    .signature-label {
        font-size: 1.3rem !important;
    }
    
    /* Progress bar step labels */
    .step-label {
        font-size: 0.9rem !important;
        line-height: 1.2;
    }
}

/* Lenders Modal */
.lenders-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    overflow: auto;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 600px) {
    .lenders-modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.lender-search {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* ─── Enhanced Lender Modal Styles ───────────────────────────────────────────── */
.lenders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    padding: 0.5rem;
}

.lender-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 180px;
    background: white;
}

.lender-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lender-option.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.lender-option.selected .lender-name {
    color: white;
}

.lender-option img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.lender-option .lender-name {
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
    max-width: 100%;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.no-logo-placeholder {
    width: 140px;
    height: 140px;
    background: var(--navy-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Mobile responsive adjustments for lender modal */
@media (max-width: 768px) {
    .lenders-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.4rem;
    }
    
    .lender-option {
        min-height: 160px;
        padding: 0.4rem;
    }
    
    .lender-option img,
    .no-logo-placeholder {
        width: 120px;
        height: 120px;
    }
    
    .lender-option .lender-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .lenders-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.3rem;
    }
    
    .lender-option {
        min-height: 140px;
    }
    
    .lender-option img,
    .no-logo-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .lender-option .lender-name {
        font-size: 0.75rem;
    }
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}


/* Hide progress bar on step 0 (welcome screen) */
#step0.active ~ #main_progress_bar,
body:has(#step0.active) #main_progress_bar {
    display: none !important;
}