/* style.css */
/* Modern desktop-first, mobile-responsive design system for FinoLanka */

:root {
    /* Fonts */
    --font-primary:   'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-secondary: 'Jost',    'Poppins', sans-serif;
    --font-sinhala:   'Noto Sans Sinhala', 'Poppins', sans-serif;
    --font-brand:     'Poppins', sans-serif;

    /* Light Theme Variables — default: Orange */
    --bg-app-outer: #f8fafc;
    --bg-app-inner: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --color-primary: #ea580c;
    --color-primary-hover: #c2410c;
    --color-primary-light: #ffedd5;
    --color-primary-gradient: linear-gradient(135deg, #ea580c, #f97316);
    
    --color-accent: #0f766e;
    --color-accent-light: #ccfbf1;
    
    --color-success: #16a34a;
    --color-danger: #dc2626;
    
    --border-color: #e2e8f0;
    --input-bg: #f8fafc;
    --input-focus-border: #ea580c;
    
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --header-bg: #ffffff;
    --header-mobile-bg: var(--color-primary-gradient);
}

/* ============================================================
   COLOR THEMES — 4 Palettes (light base, dark-mode overrides)
   ============================================================ */

/* THEME: Orange (Default) */
body.theme-orange {
    --color-primary: #ea580c;
    --color-primary-hover: #c2410c;
    --color-primary-light: #ffedd5;
    --color-primary-gradient: linear-gradient(135deg, #ea580c, #f97316);
    --input-focus-border: #ea580c;
}
body.theme-orange.dark-mode {
    --color-primary: #f97316;
    --color-primary-hover: #ea580c;
    --color-primary-light: #431407;
    --color-primary-gradient: linear-gradient(135deg, #f97316, #fb923c);
    --input-focus-border: #f97316;
}

/* THEME: Red */
body.theme-red {
    --color-primary: #dc2626;
    --color-primary-hover: #b91c1c;
    --color-primary-light: #fee2e2;
    --color-primary-gradient: linear-gradient(135deg, #dc2626, #ef4444);
    --input-focus-border: #dc2626;
}
body.theme-red.dark-mode {
    --color-primary: #ef4444;
    --color-primary-hover: #dc2626;
    --color-primary-light: #450a0a;
    --color-primary-gradient: linear-gradient(135deg, #ef4444, #f87171);
    --input-focus-border: #ef4444;
}

/* THEME: Green */
body.theme-green {
    --color-primary: #059669;
    --color-primary-hover: #047857;
    --color-primary-light: #d1fae5;
    --color-primary-gradient: linear-gradient(135deg, #059669, #10b981);
    --input-focus-border: #059669;
}
body.theme-green.dark-mode {
    --color-primary: #10b981;
    --color-primary-hover: #059669;
    --color-primary-light: #064e3b;
    --color-primary-gradient: linear-gradient(135deg, #10b981, #34d399);
    --input-focus-border: #10b981;
}

/* THEME: Purple */
body.theme-purple {
    --color-primary: #7c3aed;
    --color-primary-hover: #6d28d9;
    --color-primary-light: #ede9fe;
    --color-primary-gradient: linear-gradient(135deg, #7c3aed, #8b5cf6);
    --input-focus-border: #7c3aed;
}
body.theme-purple.dark-mode {
    --color-primary: #8b5cf6;
    --color-primary-hover: #7c3aed;
    --color-primary-light: #2e1065;
    --color-primary-gradient: linear-gradient(135deg, #8b5cf6, #a78bfa);
    --input-focus-border: #8b5cf6;
}

body.dark-mode {
    /* Dark Theme Variables */
    --bg-app-outer: #090d16;
    --bg-app-inner: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --color-primary: #f97316;
    --color-primary-hover: #ea580c;
    --color-primary-light: #431407;
    --color-primary-gradient: linear-gradient(135deg, #f97316, #fb923c);
    
    --color-accent: #14b8a6;
    --color-accent-light: #115e59;
    
    --color-success: #22c55e;
    --color-danger: #ef4444;
    
    --border-color: #1e293b;
    --input-bg: #1e293b;
    --input-focus-border: #f97316;
    
    --card-bg: #1e293b;
    
    --header-bg: #0f172a;
}

/* Brand logo image (uploaded from Settings) */
.brand-logo-img {
    height: 36px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

/* Inline SVG logo icon wrapper */
.brand-icon-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.brand-svg-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
    transition: transform 0.2s ease;
}
.brand-svg-icon:hover {
    transform: scale(1.05);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: var(--font-primary);
    background-color: var(--bg-app-outer);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container Wrapper */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* App Header styling */
.app-header {
    height: 72px;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ===== MOBILE NATIVE-APP HEADER ===== */
/* On phone screens, header becomes colored (like a native app title bar) */
@media (max-width: 768px) {
    .app-header {
        background: var(--color-primary-gradient);
        border-bottom: none;
        box-shadow: 0 2px 12px rgba(0,0,0,0.18);
        height: 64px;
    }
    /* All text/icons inside header turn white for contrast */
    .app-header .brand-name,
    .app-header .brand-accent,
    .app-header .support-text {
        color: rgba(255,255,255,0.95) !important;
    }
    .app-header .theme-toggle-btn {
        color: rgba(255,255,255,0.9);
        border-color: rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.1);
    }
    .app-header .theme-toggle-btn:hover {
        background: rgba(255,255,255,0.2);
    }
    /* SVG icon on colored header: use white-translucent background */
    .app-header .brand-svg-icon {
        filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
        background: rgba(255,255,255,0.15);
        border-radius: 9px;
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-logo {
    color: var(--color-primary);
    font-size: 24px;
}
.brand-name {
    font-family: var(--font-brand); /* Poppins */
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.brand-accent {
    color: var(--color-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.support-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .support-text {
        display: none;
    }
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
    border: 1px solid var(--border-color);
}
.theme-toggle-btn:hover {
    background-color: var(--border-color);
}

/* App Content Area */
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#loan-form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Step Progress Tracker Bar */
.progress-container {
    background-color: var(--bg-app-inner);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    transition: border-color 0.3s ease;
}
.progress-wrapper {
    max-width: 600px;
    margin: 0 auto;
}
.progress-track {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}
.progress-bar {
    height: 100%;
    background-color: var(--color-primary);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-steps-label {
    display: flex;
    justify-content: space-between;
}
.step-label {
    font-family: var(--font-sinhala);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.3s ease;
}
.step-label.active {
    color: var(--color-primary);
}

/* Step Panes Navigation */
.step-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.step-pane.active {
    display: flex;
}

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

/* Step 0 Layout (Hero Style) */
.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.03) 0%, rgba(13, 148, 136, 0.03) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    padding: 60px 20px;
    position: relative;
    z-index: 2;
}

@media (max-width: 991px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 20px;
    }
}

.hero-left {
    display: flex;
    flex-direction: column;
}

.promo-badge {
    align-self: flex-start;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    padding: 6px 14px;
    border-radius: 999px;
    font-family: var(--font-sinhala);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

body.dark-mode .promo-badge {
    background-color: color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.hero-title {
    font-family: var(--font-sinhala);
    font-size: 42px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.25;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
}

.hero-subtitle {
    font-family: var(--font-sinhala);
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 24px;
}

.trust-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.rating-stars {
    color: #f59e0b; /* Yellow rating stars */
    font-size: 14px;
    display: flex;
    gap: 2px;
}

.trust-text {
    font-family: var(--font-sinhala);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Feature List */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}
.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.feature-icon {
    font-size: 20px;
    color: var(--color-primary);
    background-color: var(--color-primary-light);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
body.dark-mode .feature-icon {
    background-color: color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.feature-text h4 {
    font-family: var(--font-sinhala);
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 4px;
}
.feature-text p {
    font-family: var(--font-sinhala);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Calculator Card */
.calc-card {
    background-color: var(--bg-app-inner);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.tabs-container {
    display: flex;
    background-color: var(--bg-app-outer);
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 24px;
}
.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 4px;
    border-radius: 10px;
    font-family: var(--font-sinhala);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.tab-btn.active {
    background-color: var(--bg-app-inner);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.calc-header {
    margin-bottom: 12px;
}
.calc-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-sinhala);
}

.amount-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}
.amount-display .currency {
    font-family: var(--font-secondary); /* Jost */
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
}
.amount-display .amount-val {
    font-family: var(--font-secondary); /* Jost */
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -2px;
    color: var(--text-primary);
}

/* Custom Range Slider */
.slider-wrapper {
    margin-bottom: 24px;
}
.custom-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
}
.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.2);
    transition: transform 0.1s;
}
.custom-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(234, 88, 12, 0.3);
}
.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-secondary); /* Jost */
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 8px;
}

/* Calculator Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stat-box {
    background-color: var(--bg-app-outer);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}
.stat-lbl {
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--font-sinhala);
    font-weight: 600;
    margin-bottom: 4px;
}
.stat-val {
    font-family: var(--font-secondary); /* Jost */
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}
.text-success {
    color: var(--color-success);
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

/* Calculator Summary */
.calc-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-sinhala);
}
.summary-row span:last-child {
    font-family: var(--font-secondary); /* Jost for amounts */
    font-weight: 700;
}
.summary-row.highlight {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}
.summary-row.highlight span:last-child {
    font-family: var(--font-secondary); /* Jost */
    color: var(--color-primary);
    font-size: 17px;
    font-weight: 800;
}

/* Step 1-3 Layout (Centered Card Grid) */
.form-container-box {
    display: flex;
    justify-content: center;
    padding: 50px 20px;
    width: 100%;
}

.step-card {
    background-color: var(--bg-app-inner);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-md);
}

@media (max-width: 480px) {
    .step-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .form-container-box {
        padding: 20px 10px;
    }
}

/* Step Header */
.step-header {
    margin-bottom: 28px;
}
.step-title {
    font-family: var(--font-sinhala);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 6px;
}
.step-subtitle {
    font-family: var(--font-sinhala);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Input Fields & Form Controls */
.form-group {
    margin-bottom: 24px;
}
.form-label {
    display: block;
    font-family: var(--font-sinhala);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.required {
    color: var(--color-danger);
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 16px;
    font-size: 16px;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    height: 52px;
    background-color: var(--input-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 0 16px 0 46px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}
.form-control:focus {
    border-color: var(--input-focus-border);
    background-color: var(--bg-app-inner);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}
.form-control::placeholder {
    font-family: var(--font-sinhala);
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
}

/* Form Errors */
.error-message {
    display: none;
    font-family: var(--font-sinhala);
    font-size: 11px;
    color: var(--color-danger);
    font-weight: 600;
    margin-top: 6px;
}
.form-group.invalid .form-control {
    border-color: var(--color-danger);
    background-color: rgba(220, 38, 38, 0.02);
}
.form-group.invalid .error-message {
    display: block;
}

/* Camera Card Widget */
.camera-card {
    background-color: var(--input-bg);
    border: 1.5px dashed var(--border-color);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.camera-preview-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: var(--bg-app-inner);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
}
.camera-placeholder {
    text-align: center;
    padding: 20px;
}
.camera-placeholder-icon {
    font-size: 44px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.camera-placeholder p {
    font-family: var(--font-sinhala);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}
.camera-placeholder span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-top: 4px;
}
#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* mirror selfie view */
}
#selfie-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.camera-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}
.file-upload-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 8px;
}
.or-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Upload Dropzones */
.upload-box-wrapper {
    margin-bottom: 24px;
}
.upload-label {
    display: block;
    font-family: var(--font-sinhala);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.upload-dropzone {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 130px;
    background-color: var(--input-bg);
    border: 1.5px dashed var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}
.upload-dropzone:hover {
    border-color: var(--color-primary);
    background-color: rgba(234, 88, 12, 0.02);
}
.dropzone-content {
    text-align: center;
    padding: 10px;
}
.upload-dropzone-icon {
    font-size: 28px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.dropzone-content p {
    font-family: var(--font-sinhala);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}
.dropzone-content span {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
    display: block;
}
.dropzone-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--bg-app-inner);
}

/* Buttons System */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 24px; /* Beautiful rounded pill button */
    font-family: var(--font-primary); /* Poppins */
    font-weight: 700;
    font-size: 14px;
    height: 48px; /* Consistent default height */
    padding: 0 28px; /* Horizontal padding */
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    letter-spacing: 0.1px;
}
.btn-sm {
    height: 38px;
    padding: 0 16px;
    font-size: 12px;
    border-radius: 19px;
}
.btn-lg {
    height: 56px;
    padding: 0 36px;
    font-size: 15px;
    border-radius: 28px;
}
.btn-block {
    width: 100%;
}
.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.3);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    filter: brightness(0.95);
}
.btn-accent {
    background-color: var(--color-accent);
    color: #ffffff;
}
.btn-success {
    background-color: var(--color-success);
    color: #ffffff;
}
.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background-color: var(--border-color);
}

/* Footer buttons inside card flow */
.step-footer {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}
.step-footer .btn {
    flex: 1;
}

/* Loading Overlay inside Card */
.loading-overlay {
    background-color: var(--bg-app-inner);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 580px;
    margin: 40px auto;
    animation: fadeIn 0.4s ease;
}
.spinner-container {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 0 auto 24px auto;
}
.double-bounce1, .double-bounce2 {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--color-primary);
    opacity: 0.6;
    position: absolute;
    top: 0;
    left: 0;
    animation: sk-bounce 2.0s infinite ease-in-out;
}
.double-bounce2 {
    animation-delay: -1.0s;
}

@keyframes sk-bounce {
    0%, 100% { 
        transform: scale(0.0);
    } 50% { 
        transform: scale(1.0);
    }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-title {
    font-family: var(--font-sinhala);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.loading-subtitle {
    font-family: var(--font-sinhala);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}
.loading-detail {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ============================================================
   DESKTOP SINGLE PAGE VIEWPORT LOCK (NO SCROLL)
   ============================================================ */
@media (min-width: 992px) {
    html, body {
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
        overflow: hidden !important;
    }
    .app-wrapper {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }
    .app-content {
        height: calc(100vh - 72px);
        overflow: hidden;
    }
    #loan-form {
        height: 100%;
        overflow: hidden;
    }
    .step-pane {
        height: 100%;
        overflow-y: auto;
    }
    #step-0 {
        height: 100%;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .hero-container {
        height: 100%;
        padding: 0 20px;
        grid-template-columns: 1fr 1.15fr;
        align-content: center;
        gap: 30px;
    }
    
    /* Make contents a little bit smaller on desktop to prevent overflow */
    .hero-title {
        font-size: 34px !important;
        margin-bottom: 12px;
    }
    .hero-subtitle {
        font-size: 14px !important;
        line-height: 1.5;
        margin-bottom: 20px;
    }
    .trust-container {
        margin-bottom: 20px;
    }
    .calc-card {
        padding: 24px 28px;
        border-radius: 24px;
        width: 100%;
        max-width: 510px;
        margin-left: auto;
    }
    .tabs-container {
        margin-bottom: 20px;
    }
    .tab-btn {
        padding: 10px 4px;
        font-size: 13px;
    }
    .amount-display {
        margin-bottom: 18px;
    }
    .amount-display .amount-val {
        font-size: 48px;
    }
    .amount-display .currency {
        font-size: 20px;
    }
    .slider-wrapper {
        margin-bottom: 20px;
    }
    .stats-grid {
        gap: 10px;
    }
    .stat-box {
        padding: 10px;
        border-radius: 12px;
    }
    .divider {
        margin: 16px 0;
    }
    .calc-summary {
        margin-bottom: 20px;
        gap: 8px;
    }
    .btn-lg {
        height: 52px;
        font-size: 15px;
        padding: 0 28px;
        border-radius: 26px;
    }
    
    /* Horizontal Features List Layout */
    .features-list-desktop {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-top: 25px;
        width: 100%;
    }
    .features-list-desktop .feature-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .features-list-desktop .feature-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
    }
    .features-list-desktop .feature-text h4 {
        font-size: 12px;
        font-weight: 800;
    }
    .features-list-desktop .feature-text p {
        font-size: 10px;
    }
    
    .features-list-mobile {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .features-list-desktop {
        display: none !important;
    }
}
