/* MOBILE LOAN JOURNEY FIXES */
/* Comprehensive mobile fixes for all loan journey pages */

@media (max-width: 768px) {
    
    /* RESET AND BASE STYLES */
    * {
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }
    
    body {
        margin: 0 !important;
        padding: 0 !important;
        background-color: #f8fafc !important;
        overflow-x: hidden !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    }

    /* FORCE HEADER TO TOP */
    .navbar,
    nav.navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        z-index: 10000 !important;
        background: white !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
        height: auto !important;
        min-height: 70px !important;
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #e2e8f0 !important;
        transform: translateZ(0) !important;
        will-change: transform !important;
        order: -1 !important;
        margin: 0 !important;
    }

    /* NAVIGATION CONTAINER */
    .nav-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    /* LOGO SECTION - LARGER SIZE */
    .nav-logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
        width: 100% !important;
        justify-content: flex-start !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* LARGER LOGO FOR MOBILE */
    .loan-logo,
    .nav-logo img {
        height: 40px !important;
        width: auto !important;
        max-width: 120px !important;
        display: block !important;
        object-fit: contain !important;
        border-radius: 6px !important;
    }

    /* STEP INDICATORS CONTAINER */
    .nav-steps {
        display: flex !important;
        gap: 0.5rem !important;
        width: 100% !important;
        overflow-x: auto !important;
        padding: 0.25rem 0 !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin: 0 !important;
    }

    /* OPTIMIZED STEP INDICATORS FOR MOBILE */
    .step-indicator,
    .step {
        min-width: 55px !important;
        max-width: 55px !important;
        text-align: center !important;
        padding: 0.25rem !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* STEP NUMBERS/CIRCLES - OPTIMIZED MOBILE SIZE */
    .step-indicator .step-number,
    .step-number,
    .step-circle,
    .step-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
        line-height: 24px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto 0.3rem !important;
        background: #e5e7eb !important;
        color: #6b7280 !important;
        border: 1px solid #e5e7eb !important;
        text-align: center !important;
        font-weight: 600 !important;
        min-width: 24px !important;
        min-height: 24px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }

    /* ACTIVE STEP STYLING */
    .step-indicator .step-number.active,
    .step-number.active,
    .step.active .step-circle {
        background: #3b82f6 !important;
        border-color: #3b82f6 !important;
        color: white !important;
    }

    /* COMPLETED STEP STYLING */
    .step-indicator .step-number.completed,
    .step-number.completed {
        background: #10b981 !important;
        border-color: #10b981 !important;
        color: white !important;
    }

    /* STEP TEXT - READABLE SIZE */
    .step-text,
    .step span {
        font-size: 0.75rem !important;
        margin-top: 0.25rem !important;
        text-align: center !important;
        line-height: 1.2 !important;
        color: #6b7280 !important;
        font-weight: 500 !important;
    }

    /* MAIN CONTENT - PROPER SPACING FOR MOBILE */
    .main-content,
    main {
        margin-top: 100px !important;
        padding: 0.5rem !important;
        width: 100% !important;
        background: #f8fafc !important;
        min-height: calc(100vh - 100px) !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }

    /* STEP CONTENT CONTAINERS - IMPROVED SPACING */
    .step-content {
        padding: 0.5rem !important;
        margin: 0 !important;
        width: 100% !important;
        background: transparent !important;
        min-height: auto !important;
        overflow: visible !important;
    }
    
    .container {
        padding: 0.5rem !important;
        margin: 0 !important;
        width: 100% !important;
        background: transparent !important;
        max-width: 100% !important;
    }

    /* CONTENT WRAPPERS */
    .content-wrapper,
    .loan-application-layout,
    .two-column-layout {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
    }

    /* LEFT/RIGHT SECTIONS */
    .left-section,
    .right-section {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 0 1rem 0 !important;
        background: white !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    }

    /* FORM CARDS */
    .form-card,
    .application-form {
        padding: 1.5rem !important;
        margin: 0 !important;
        background: white !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    }

    /* FORM HEADERS */
    .form-header,
    .product-header {
        text-align: center !important;
        margin-bottom: 1.5rem !important;
        padding: 0 !important;
    }

    .form-header h1,
    .product-header h1 {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        color: #1f2937 !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.3 !important;
    }

    .form-header p,
    .product-header p {
        font-size: 1rem !important;
        color: #6b7280 !important;
        line-height: 1.5 !important;
        margin-bottom: 0 !important;
    }

    /* PRODUCT IMAGES */
    .product-image {
        height: 60px !important;
        width: auto !important;
        margin: 0 auto 1rem !important;
        display: block !important;
        object-fit: contain !important;
    }

    /* FORM GROUPS */
    .form-group {
        margin-bottom: 1.5rem !important;
        width: 100% !important;
    }

    /* FORM LABELS */
    .form-group label {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        color: #374151 !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
    }

    /* INPUT FIELDS */
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        border: 2px solid #e5e7eb !important;
        border-radius: 8px !important;
        background: #ffffff !important;
        transition: border-color 0.3s ease !important;
        box-sizing: border-box !important;
    }

    .form-group input:focus,
    .form-group select:focus {
        outline: none !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    }

    /* PHONE INPUT CONTAINERS */
    .phone-input-container,
    .phone-input-group,
    .input-container {
        display: flex !important;
        align-items: center !important;
        border: 1px solid #d1d5db !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        background: white !important;
    }

    .country-code {
        padding: 12px 16px !important;
        background: #f9fafb !important;
        border-right: 1px solid #e5e7eb !important;
        font-weight: 600 !important;
        color: #374151 !important;
        font-size: 1rem !important;
        white-space: nowrap !important;
    }

    .phone-input-container input,
    .phone-input-group input {
        border: none !important;
        flex: 1 !important;
        padding: 12px 16px !important;
        font-size: 1rem !important;
        background: transparent !important;
    }

    /* BUTTONS */
    .btn,
    .btn-primary,
    .continue-btn,
    .proceed-btn,
    .submit-btn {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        border: none !important;
        background: #3b82f6 !important;
        color: white !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        margin-top: 1rem !important;
        text-align: center !important;
        display: block !important;
        text-decoration: none !important;
    }

    .btn:hover,
    .btn-primary:hover {
        background: #2563eb !important;
        transform: translateY(-1px) !important;
    }

    /* FEATURE GRIDS */
    .feature-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
        margin: 1.5rem 0 !important;
    }

    .feature-card {
        padding: 1rem !important;
        background: #f8fafc !important;
        border-radius: 8px !important;
        text-align: center !important;
        border: 1px solid #e2e8f0 !important;
    }

    .feature-card i {
        font-size: 1.5rem !important;
        color: #3b82f6 !important;
        margin-bottom: 0.5rem !important;
    }

    .feature-card h3 {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.25rem !important;
        color: #1f2937 !important;
    }

    .feature-card p {
        font-size: 0.8rem !important;
        color: #6b7280 !important;
        line-height: 1.3 !important;
    }

    /* NAVIGATION ARROWS - SMALLER FOR MOBILE */
    .step-navigation {
        position: fixed !important;
        top: 50% !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        pointer-events: none !important;
        transform: translateY(-50%) !important;
    }

    .nav-arrow {
        position: absolute !important;
        width: 45px !important;
        height: 45px !important;
        background: #3b82f6 !important;
        border: none !important;
        border-radius: 50% !important;
        color: white !important;
        font-size: 16px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
        pointer-events: auto !important;
    }

    .nav-back {
        left: 15px !important;
    }

    .nav-forward {
        right: 15px !important;
    }

    /* HOME LOAN SPECIFIC FIXES */
    .home-loan-container {
        display: block !important;
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .left-panel,
    .right-panel {
        width: 100% !important;
        padding: 1.5rem !important;
        margin: 0 !important;
        background: white !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
        margin-bottom: 1rem !important;
    }

    .home-loan-header h1 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
        text-align: center !important;
    }

    .home-loan-icon {
        width: 80px !important;
        height: 80px !important;
        margin: 1rem auto !important;
        font-size: 2.5rem !important;
    }

    /* LOAN AMOUNT/CITY GRIDS */
    .loan-amount-grid,
    .city-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        margin: 1rem 0 !important;
    }

    .amount-option,
    .city-option {
        padding: 0.75rem !important;
        text-align: center !important;
        border-radius: 8px !important;
        border: 2px solid #e2e8f0 !important;
        background: white !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        font-size: 0.9rem !important;
    }

    .amount-option.selected,
    .city-option.selected {
        border-color: #3b82f6 !important;
        background: #3b82f6 !important;
        color: white !important;
    }

    /* RECAPTCHA/CAPTCHA GROUPS */
    .recaptcha-group,
    .captcha-group {
        margin: 1.5rem 0 !important;
    }

    .custom-recaptcha,
    .captcha-container {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        background: #f9fafb !important;
        cursor: pointer !important;
    }

    .recaptcha-checkbox,
    .captcha-display {
        width: 24px !important;
        height: 24px !important;
        border: 2px solid #d1d5db !important;
        border-radius: 4px !important;
        background: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ERROR MESSAGES */
    .error-message {
        color: #dc2626 !important;
        font-size: 0.875rem !important;
        margin-top: 0.5rem !important;
        display: block !important;
    }

    /* CONSENT TEXT */
    .consent-text {
        font-size: 0.8rem !important;
        color: #6b7280 !important;
        line-height: 1.4 !important;
        margin: 1rem 0 !important;
    }

    .consent-text a {
        color: #3b82f6 !important;
        text-decoration: underline !important;
    }

    /* FEATURES LIST */
    .features-list ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 1.5rem 0 !important;
    }

    .features-list li {
        padding: 0.5rem 0 !important;
        font-size: 0.9rem !important;
        color: #374151 !important;
        border-bottom: 1px solid #f3f4f6 !important;
    }

    .features-list li:last-child {
        border-bottom: none !important;
    }

    /* HIDE DESKTOP-ONLY ELEMENTS */
    .desktop-only {
        display: none !important;
        visibility: hidden !important;
    }

    /* REMOVE ALL EXTRA SPACING AND PADDING */
    .mobile-form-section {
        padding: 0 !important;
        margin: 0 !important;
    }

    .form-section {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* ENSURE CONSISTENT SPACING */
    .form-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    .form-subtitle {
        font-size: 0.9rem !important;
        color: #6b7280 !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }

    /* FIX ANY FLOATING OR MISALIGNED ELEMENTS */
    * {
        position: relative !important;
    }

    .step-content * {
        float: none !important;
        clear: both !important;
    }
}