/* ===== LOANSPACE.AI - PROFESSIONAL & TRUSTWORTHY ===== */
/* Clean, minimal design focused on clarity and credibility */
/* Load this AFTER style-improvements.css */

:root {
    /* Professional Color Palette - Conservative & Trustworthy */
    --trust-navy: #0f2942;      /* Deep navy - authority */
    --trust-blue: #2563eb;      /* Clean blue - professionalism */
    --trust-gray: #64748b;      /* Neutral gray - balance */
    --trust-light: #f8fafc;     /* Clean white-gray background */
    
    /* Text - High Contrast for Clarity */
    --text-primary: #0f172a;    /* Almost black - maximum readability */
    --text-secondary: #334155;  /* Dark gray - hierarchy */
    --text-muted: #64748b;      /* Medium gray - supporting text */
    
    /* Backgrounds - Clean & Simple */
    --bg-primary: #ffffff;      /* Pure white */
    --bg-secondary: #f8fafc;    /* Barely gray */
    --bg-tertiary: #f1f5f9;     /* Subtle gray */
    
    /* Borders - Subtle Definition */
    --border-main: #e2e8f0;     /* Light gray borders */
    --border-focus: #2563eb;    /* Blue for interactive states */
    
    /* Shadows - Minimal & Professional */
    --shadow-subtle: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-focus: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* ============================================
   REMOVE ALL DISTRACTING ELEMENTS
   ============================================ */

/* No background animations - pure white background */
body::before,
body::after {
    display: none !important;
}

body {
    background: var(--bg-primary) !important;
}

/* No floating animations */
@keyframes float {
    0%, 100% { transform: none; }
}

.feature-card-modern,
.feature-card,
.card {
    animation: none !important;
}

/* ============================================
   CLEAN TYPOGRAPHY - MAXIMUM READABILITY
   ============================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif !important;
    color: var(--text-primary) !important;
    line-height: 1.6 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headlines - Bold and Clear */
h1,
.welcome-title,
.hero-title {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
    margin-bottom: 16px !important;
}

/* Subtitles - Professional Hierarchy */
.welcome-subtitle,
.hero-subtitle {
    font-size: 18px !important;
    font-weight: 400 !important;
    color: var(--text-secondary) !important;
    line-height: 1.6 !important;
}

/* Body Text - Clear and Readable */
p {
    font-size: 16px !important;
    color: var(--text-secondary) !important;
    line-height: 1.6 !important;
}

/* ============================================
   SIDEBAR - CLEAN & FUNCTIONAL
   ============================================ */

.sidebar {
    background: var(--bg-primary) !important;
    border-right: 1px solid var(--border-main) !important;
    box-shadow: none !important;
}

.sidebar-logo {
    padding: 24px 16px !important;
}

.sidebar-section {
    padding: 16px 12px !important;
}

.sidebar-item,
.sidebar-item-link {
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    transition: background-color 0.15s ease !important;
}

.sidebar-item:hover:not(.active),
.sidebar-item-link:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.sidebar-item.active {
    background: var(--trust-blue) !important;
    color: white !important;
}

/* Rate Widget - Simple Card */
.rate-widget {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: none !important;
}

.rate-widget-header {
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-muted) !important;
    margin-bottom: 12px !important;
}

.rate-value {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}

/* ============================================
   FEATURE CARDS - MINIMAL & PROFESSIONAL
   ============================================ */

.features-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    margin: 32px 0 !important;
}

.feature-card-modern,
.feature-card,
.card {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: 12px !important;
    padding: 24px !important;
    box-shadow: var(--shadow-subtle) !important;
    transition: all 0.2s ease !important;
}

.feature-card-modern:hover,
.feature-card:hover,
.card:hover {
    border-color: var(--trust-blue) !important;
    box-shadow: var(--shadow-card) !important;
    transform: translateY(-2px) !important;
}

/* Icons - Simple & Clear */
.feature-icon {
    width: 48px !important;
    height: 48px !important;
    background: var(--bg-secondary) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 16px !important;
}

.feature-icon i {
    font-size: 24px !important;
    color: var(--trust-blue) !important;
}

.feature-title {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin-bottom: 8px !important;
}

.feature-description {
    font-size: 15px !important;
    color: var(--text-muted) !important;
    line-height: 1.5 !important;
}

/* Clickable Question Cards */
.question-card {
    cursor: pointer !important;
    user-select: none !important;
}

.question-card:active {
    transform: translateY(0px) !important;
    box-shadow: var(--shadow-subtle) !important;
}

/* Link-style card (closing costs) */
a.question-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block !important;
}

/* ============================================
   WELCOME BANNER - CLEAN HERO
   ============================================ */

.welcome-banner {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: 16px !important;
    padding: 48px 32px !important;
    margin-bottom: 32px !important;
    box-shadow: var(--shadow-subtle) !important;
}

.welcome-hero {
    max-width: 720px !important;
    margin: 0 auto 40px !important;
    text-align: center !important;
}

/* ============================================
   CHAT INTERFACE - FOCUSED & CLEAN
   ============================================ */

#chatbox,
.chat-container {
    background: var(--bg-primary) !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: none !important;
}

/* Message Bubbles - Clear Distinction */
.message.user .message-content {
    background: var(--trust-blue) !important;
    color: white !important;
    border-radius: 18px !important;
    padding: 12px 18px !important;
    box-shadow: var(--shadow-subtle) !important;
}

.message.assistant .message-content {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: 18px !important;
    padding: 12px 18px !important;
}

/* ============================================
   INPUT AREA - CLEAN & PROFESSIONAL
   ============================================ */

.input-area {
    background: var(--bg-primary) !important;
    border-top: 1px solid var(--border-main) !important;
    padding: 20px !important;
    box-shadow: none !important;
}

#userInput {
    background: var(--bg-secondary) !important;
    border: 2px solid var(--border-main) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    font-size: 16px !important;
    color: var(--text-primary) !important;
    transition: all 0.15s ease !important;
}

#userInput:focus {
    outline: none !important;
    border-color: var(--border-focus) !important;
    box-shadow: var(--shadow-focus) !important;
    background: var(--bg-primary) !important;
}

#userInput::placeholder {
    color: var(--text-muted) !important;
}

/* ============================================
   BUTTONS - PROFESSIONAL & CLEAR
   ============================================ */

#sendButton,
.btn-primary {
    background: var(--trust-blue) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: var(--shadow-subtle) !important;
}

#sendButton:hover,
.btn-primary:hover {
    background: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-card) !important;
}

#sendButton:active,
.btn-primary:active {
    transform: translateY(0) !important;
}

/* Secondary Buttons */
.btn-secondary,
#speechButton,
.upload-button {
    background: var(--bg-primary) !important;
    border: 2px solid var(--border-main) !important;
    border-radius: 10px !important;
    padding: 12px 20px !important;
    color: var(--text-secondary) !important;
    transition: all 0.15s ease !important;
}

.btn-secondary:hover,
#speechButton:hover,
.upload-button:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--text-muted) !important;
}

/* ============================================
   HEADER - MINIMAL & PROFESSIONAL
   ============================================ */

header {
    background: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-main) !important;
    box-shadow: none !important;
}

header img.logo {
    box-shadow: none !important;
}

/* Login/Register Buttons */
.login-button,
.register-button {
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

.login-button {
    background: var(--trust-blue) !important;
    color: white !important;
}

.register-button {
    background: transparent !important;
    color: var(--trust-blue) !important;
    border: 2px solid var(--trust-blue) !important;
}

/* ============================================
   LOADING STATES - SIMPLE & CLEAR
   ============================================ */

.thinking,
.loading {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    color: var(--text-secondary) !important;
}

.spinner {
    border: 3px solid var(--bg-tertiary) !important;
    border-top-color: var(--trust-blue) !important;
}

.error {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
}

/* ============================================
   SCROLLBAR - MINIMAL
   ============================================ */

::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

::-webkit-scrollbar-track {
    background: transparent !important;
}

::-webkit-scrollbar-thumb {
    background: var(--border-main) !important;
    border-radius: 3px !important;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted) !important;
}

/* ============================================
   SPACING & LAYOUT - GENEROUS WHITE SPACE
   ============================================ */

.main-content,
.chat-area {
    padding: 32px !important;
}

.welcome-banner {
    margin-bottom: 32px !important;
}

.features-grid {
    margin: 32px 0 !important;
}

/* Section Spacing */
section {
    margin-bottom: 48px !important;
}

/* ============================================
   LINKS - PROFESSIONAL
   ============================================ */

a {
    color: var(--trust-blue) !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

a:hover {
    color: #1d4ed8 !important;
}

/* ============================================
   WELCOME BANNER V2 - FUNNEL-STYLE CARDS
   ============================================ */

.welcome-banner-v2 {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 0 20px;
}

.welcome-title-v2 {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--text-primary, #1e293b) !important;
    text-align: center !important;
    margin-bottom: 8px !important;
    line-height: 1.3 !important;
}

.welcome-subtitle-v2 {
    text-align: center;
    font-size: 16px;
    color: #64748b;
    margin: 0 0 24px;
    line-height: 1.5;
    font-weight: 400;
}

.welcome-cards-v2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.welcome-card-v2 {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.welcome-card-v2:hover {
    border-color: #818cf8;
    box-shadow: 0 2px 12px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.wc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 20px;
    flex-shrink: 0;
}

/* ---- Welcome Card Color Themes (gradient icons) ---- */
.wc-blue .wc-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}
.wc-blue:hover { border-color: #3b82f6; box-shadow: 0 3px 16px rgba(59, 130, 246, 0.12); }

.wc-teal .wc-icon {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    box-shadow: 0 3px 10px rgba(20, 184, 166, 0.3);
}
.wc-teal:hover { border-color: #14b8a6; box-shadow: 0 3px 16px rgba(20, 184, 166, 0.12); }

.wc-amber .wc-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}
.wc-amber:hover { border-color: #f59e0b; box-shadow: 0 3px 16px rgba(245, 158, 11, 0.12); }

.wc-green .wc-icon {
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: #fff;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3);
}
.wc-green:hover { border-color: #22c55e; box-shadow: 0 3px 16px rgba(34, 197, 94, 0.12); }

.wc-purple .wc-icon {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    box-shadow: 0 3px 10px rgba(168, 85, 247, 0.3);
}
.wc-purple:hover { border-color: #a855f7; box-shadow: 0 3px 16px rgba(168, 85, 247, 0.12); }

.wc-rose .wc-icon {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    box-shadow: 0 3px 10px rgba(244, 63, 94, 0.3);
}
.wc-rose:hover { border-color: #f43f5e; box-shadow: 0 3px 16px rgba(244, 63, 94, 0.12); }

.wc-text {
    flex: 1;
    min-width: 0;
}

.wc-label {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
}

.wc-desc {
    font-size: 14px;
    color: #64748b;
}

.wc-arrow {
    color: #cbd5e1;
    font-size: 16px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.welcome-card-v2:hover .wc-arrow {
    color: #4f46e5;
}

.welcome-hint-v2 {
    text-align: center;
    font-size: 14px;
    color: #94a3b8;
    margin-top: 20px;
    padding: 0;
}

@media (max-width: 640px) {
    .welcome-banner-v2 {
        padding: 4px 0 4px;
    }

    .welcome-title-v2 {
        font-size: 18px !important;
        margin-bottom: 2px !important;
        padding: 0 8px;
    }

    .welcome-subtitle-v2 {
        font-size: 13px;
        margin-bottom: 8px;
        padding: 0 12px;
    }

    .welcome-card-v2 {
        padding: 12px 14px;
    }

    .wc-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .wc-label {
        font-size: 14px;
    }

    .wc-desc {
        font-size: 12px;
    }
}

/* ============================================
   FIND A LENDER — INLINE LEAD FORM
   ============================================ */

.lender-form-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 16px 40px;
}

.lender-form-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    text-align: center;
}

.lf-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.lf-icon-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.lf-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f2942;
    margin: 0 0 8px;
}

.lf-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 24px;
    line-height: 1.5;
}

.lf-form {
    text-align: left;
}

.lf-field {
    margin-bottom: 20px;
}

.lf-field label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.lf-req {
    color: #ef4444;
}

.lf-opt {
    font-weight: 400;
    color: #94a3b8;
    font-size: 14px;
}

.lf-field input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.lf-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
    background: #fff;
}

.lf-field input::placeholder {
    color: #94a3b8;
    font-size: 16px;
}

.lf-select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    cursor: pointer;
}

.lf-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
    background-color: #fff;
}

[data-theme="dark"] .lf-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none'/%3E%3C/svg%3E");
}

[data-theme="dark"] .lf-select:focus {
    border-color: #3b82f6;
    background-color: #1e293b;
}

.lf-submit {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    transition: transform 0.15s, box-shadow 0.2s;
}

.lf-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}

.lf-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.lf-back-btn {
    margin-top: 20px;
    background: linear-gradient(135deg, #475569, #64748b);
}

.lf-disclaimer {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin: 16px 0 0;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.lf-disclaimer i {
    color: #10b981;
    font-size: 14px;
}

.lf-success .lf-subtitle {
    margin-bottom: 0;
}

/* Dark mode */
[data-theme="dark"] .lender-form-card {
    background: #1e293b;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

[data-theme="dark"] .lf-title {
    color: #f1f5f9;
}

[data-theme="dark"] .lf-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .lf-field label {
    color: #cbd5e1;
}

[data-theme="dark"] .lf-field input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .lf-field input:focus {
    border-color: #3b82f6;
    background: #1e293b;
}

[data-theme="dark"] .lf-field input::placeholder {
    color: #475569;
}

@media (max-width: 640px) {
    .lender-form-wrap {
        padding: 12px 8px 30px;
    }

    .lender-form-card {
        padding: 28px 20px;
    }

    .lf-title {
        font-size: 19px;
    }

    .lf-subtitle {
        font-size: 14px;
    }

    .lf-field input {
        padding: 14px 16px;
        font-size: 17px;
    }

    .lf-submit {
        padding: 16px 20px;
        font-size: 17px;
    }
}

/* ============================================
   POWERED BY - SUBTLE
   ============================================ */

.powered-by {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    text-align: center !important;
    padding: 16px !important;
    background: transparent !important;
    border: none !important;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    .welcome-banner {
        padding: 32px 24px !important;
    }
    
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    h1,
    .welcome-title {
        font-size: 28px !important;
    }
    
    .welcome-subtitle {
        font-size: 16px !important;
    }
}

/* ============================================
   FOCUS STATES - ACCESSIBILITY
   ============================================ */

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--trust-blue) !important;
    outline-offset: 2px !important;
}

/* ============================================
   NO ANIMATIONS - FAST & PROFESSIONAL
   ============================================ */

* {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0.15s !important; /* Keep only instant transitions */
}

/* Exception: Allow essential transitions */
button,
a,
input,
.sidebar-item {
    transition-duration: 0.15s !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .sidebar,
    .input-area,
    header,
    .powered-by {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* ============================================
   END - PROFESSIONAL & TRUSTWORTHY DESIGN
   ============================================ */
