/* =========================================
   IVANA - OTP Banka Agro Kredit AI
   Premium Design System v2.0
   OTP Brand Colors: Green Theme
   ========================================= */

/* === CSS Variables === */
:root {
    /* OTP Brand Colors - GREEN */
    --otp-green-dark: #006341;
    --otp-green: #008752;
    --otp-green-light: #52AE30;
    --otp-green-bright: #7BC144;
    --otp-green-pale: #B4D88B;
    
    /* Primary Palette (Green) */
    --primary-50: #ECFDF5;
    --primary-100: #D1FAE5;
    --primary-200: #A7F3D0;
    --primary-300: #6EE7B7;
    --primary-400: #34D399;
    --primary-500: #008752;
    --primary-600: #006341;
    --primary-700: #005236;
    --primary-800: #003D29;
    --primary-900: #002E1F;
    
    /* Accent Colors */
    --accent-lime: #7BC144;
    --accent-gold: #D4AF37;
    
    /* Neutral Palette */
    --neutral-0: #FFFFFF;
    --neutral-50: #FAFAFA;
    --neutral-100: #F5F5F5;
    --neutral-200: #E5E5E5;
    --neutral-300: #D4D4D4;
    --neutral-400: #A3A3A3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    --neutral-950: #0A0A0A;
    
    /* Semantic */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.12);
    
    /* Light Theme */
    --bg-primary: #F8FAF9;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F0F4F2;
    --bg-elevated: #FFFFFF;
    --bg-accent: rgba(0, 135, 82, 0.08);
    --bg-accent-strong: rgba(0, 135, 82, 0.15);
    
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-tertiary: #A3A3A3;
    --text-inverse: #FFFFFF;
    --text-accent: #006341;
    
    --border-primary: rgba(0, 99, 65, 0.15);
    --border-secondary: rgba(0, 99, 65, 0.08);
    --border-accent: rgba(0, 135, 82, 0.3);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 99, 65, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 99, 65, 0.06), 0 1px 2px rgba(0, 99, 65, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 99, 65, 0.08), 0 2px 4px rgba(0, 99, 65, 0.04);
    --shadow-lg: 0 8px 16px rgba(0, 99, 65, 0.1), 0 4px 8px rgba(0, 99, 65, 0.06);
    --shadow-xl: 0 16px 32px rgba(0, 99, 65, 0.12), 0 8px 16px rgba(0, 99, 65, 0.08);
    --shadow-glow: 0 0 60px rgba(0, 135, 82, 0.25);
    --shadow-glow-strong: 0 0 80px rgba(82, 174, 48, 0.35);
    
    /* Typography */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border Radius - OTP Rounded Style */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-fast: 150ms var(--ease-out-expo);
    --transition-base: 300ms var(--ease-out-expo);
    --transition-slow: 500ms var(--ease-out-expo);
    
    /* Layout */
    --header-height: 72px;
    --panel-width: 380px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0C1410;
    --bg-secondary: #121A16;
    --bg-tertiary: #1A2620;
    --bg-elevated: #151E19;
    --bg-accent: rgba(82, 174, 48, 0.12);
    --bg-accent-strong: rgba(82, 174, 48, 0.2);
    
    --text-primary: #F5F5F5;
    --text-secondary: #A3A3A3;
    --text-tertiary: #737373;
    --text-accent: #7BC144;
    
    --border-primary: rgba(82, 174, 48, 0.2);
    --border-secondary: rgba(82, 174, 48, 0.1);
    --border-accent: rgba(123, 193, 68, 0.4);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 60px rgba(82, 174, 48, 0.2);
}

/* === Base Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* === Animated Background === */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--otp-green-light) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--otp-green) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--otp-green-bright) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.2;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* === Loading Screen === */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--otp-green-dark) 0%, var(--otp-green) 50%, var(--otp-green-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s var(--ease-out-expo), visibility 0.6s var(--ease-out-expo);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.loading-logo-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto var(--space-8);
}

.loading-bank-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: auto;
    filter: brightness(0) invert(1);
    z-index: 2;
}

.loading-spinner {
    position: absolute;
    inset: 0;
}

.loading-spinner svg {
    width: 100%;
    height: 100%;
    animation: spin 2s linear infinite;
}

.loading-spinner circle {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-dasharray: 280;
    stroke-dashoffset: 80;
    stroke-linecap: round;
    animation: dash 2s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dashoffset: 280; stroke: rgba(255, 255, 255, 0.3); }
    50% { stroke-dashoffset: 80; stroke: rgba(255, 255, 255, 0.8); }
    100% { stroke-dashoffset: 280; stroke: rgba(255, 255, 255, 0.3); }
}

.loading-text h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-2);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.loading-text p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--space-8);
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* === Welcome Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 30, 20, 0.85);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-4);
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-card {
    position: relative;
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    overflow: hidden;
    animation: modalEnter 0.7s var(--ease-out-back);
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--border-accent);
    opacity: 0.3;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -100px;
    animation: rotate 30s linear infinite;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -50px;
    animation: rotate 20s linear infinite reverse;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

.decoration-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
    height: 1px;
}

.line-1 {
    width: 100%;
    top: 50%;
    animation: shimmer 3s ease-in-out infinite;
}

.line-2 {
    width: 60%;
    top: 70%;
    left: 20%;
    animation: shimmer 3s ease-in-out infinite 1.5s;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.5; }
}

.modal-hero {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--otp-green-dark) 0%, var(--otp-green) 50%, var(--otp-green-light) 100%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.avatar-container {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.avatar-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, var(--otp-green-light) 0%, transparent 70%);
    opacity: 0.5;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.avatar-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.avatar-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--otp-green-light) 0%, var(--otp-green) 100%);
    border-radius: 50%;
    border: 3px solid var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 3;
}

.avatar-badge svg {
    width: 16px;
    height: 16px;
}

.modal-body {
    padding: calc(var(--space-12) + 10px) var(--space-8) var(--space-8);
    text-align: center;
}

.modal-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-4);
    background: var(--bg-accent);
    color: var(--text-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
    border: 1px solid var(--border-accent);
}

.modal-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-3);
    background: linear-gradient(135deg, var(--otp-green-dark) 0%, var(--otp-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: var(--space-6);
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    text-align: left;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.feature-item:hover {
    background: var(--bg-accent);
    border-color: var(--border-accent);
    transform: translateX(4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.feature-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cta-button {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 20px rgba(0, 135, 82, 0.4);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 135, 82, 0.5);
}

.cta-button:active {
    transform: translateY(-1px);
}

.cta-icon {
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast);
}

.cta-button:hover .cta-icon {
    transform: translateX(6px);
}

.cta-icon svg {
    width: 22px;
    height: 22px;
}

.cta-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-secondary);
}

.footer-logo {
    height: 24px;
    width: auto;
    opacity: 0.7;
}

.modal-footer span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* === Toast Notification === */
.toast {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--error);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    transform: translateX(calc(100% + var(--space-6)));
    transition: transform var(--transition-base);
}

.toast.visible {
    transform: translateX(0);
}

.toast-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--error-bg);
    border-radius: var(--radius-md);
    color: var(--error);
    flex-shrink: 0;
}

.toast-icon svg {
    width: 22px;
    height: 22px;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.toast-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    margin-left: var(--space-2);
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* === App Container === */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.app-container.visible {
    opacity: 1;
}

/* === Header === */
.app-header {
    height: var(--header-height);
    padding: 0 var(--space-6);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.header-logo {
    height: 36px;
    width: auto;
}

.brand-separator {
    width: 1px;
    height: 32px;
    background: var(--border-primary);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--otp-green-dark) 0%, var(--otp-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: var(--space-2);
}

.header-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: var(--bg-accent);
    border-color: var(--border-accent);
    color: var(--text-accent);
    transform: scale(1.05);
}

.header-btn.danger:hover {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

.icon-sun, .icon-moon {
    display: none;
}

[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }

/* === Main Content === */
.main-content {
    flex: 1;
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    min-height: 0;
    overflow: hidden;
}

/* === Dashboard Panel === */
.dashboard-panel {
    width: var(--panel-width);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    overflow-y: auto;
    flex-shrink: 0;
    padding-right: var(--space-2);
}

.dashboard-panel::-webkit-scrollbar {
    width: 6px;
}

.dashboard-panel::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-panel::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.dashboard-panel::-webkit-scrollbar-thumb:hover {
    background: var(--border-accent);
}

/* === Cards === */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

.card-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.card-badge {
    font-size: 0.7rem;
    padding: var(--space-1) var(--space-3);
    background: var(--bg-accent);
    color: var(--text-accent);
    border-radius: var(--radius-full);
    font-weight: 600;
    border: 1px solid var(--border-accent);
}

.phase-badge {
    font-size: 0.7rem;
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-light) 100%);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.phase-badge.locked {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.phase-badge.complete {
    background: linear-gradient(135deg, var(--success) 0%, #34D399 100%);
}

/* === Profile Card === */
.profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    border: 3px solid var(--border-primary);
    transition: all var(--transition-base);
}

.profile-avatar svg {
    width: 32px;
    height: 32px;
}

.profile-avatar.active {
    background: var(--bg-accent);
    border-color: var(--otp-green);
    color: var(--otp-green);
    box-shadow: 0 0 30px rgba(0, 135, 82, 0.3);
}

.profile-fields {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.profile-field.empty {
    opacity: 0.5;
}

.profile-field.filled {
    background: var(--bg-accent);
    border-color: var(--border-accent);
    opacity: 1;
    animation: fieldAppear 0.5s var(--ease-out-back);
}

@keyframes fieldAppear {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
}

.field-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.field-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-field.filled .field-value {
    color: var(--text-accent);
}

/* === Risk Card === */
.risk-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.risk-gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-container {
    position: relative;
    width: 100%;
    max-width: 240px;
}

.gauge-svg {
    width: 100%;
    height: auto;
}

.gauge-progress {
    transition: stroke-dashoffset 1.5s var(--ease-out-expo);
}

.gauge-needle {
    transform-origin: 100px 100px;
    transition: transform 1.5s var(--ease-out-expo);
    transform: rotate(-90deg);
}

.gauge-score {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.score-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    font-weight: 600;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 200px;
    margin-top: var(--space-2);
    font-size: 0.7rem;
    font-weight: 600;
}

.label-low { color: var(--success); }
.label-mid { color: var(--warning); }
.label-high { color: var(--error); }

.progress-section {
    width: 100%;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    font-weight: 500;
}

.progress-track {
    position: relative;
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--otp-green-dark) 0%, var(--otp-green-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.8s var(--ease-out-expo);
    position: relative;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

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

.risk-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
}

.risk-field-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.risk-field-item.collected {
    background: var(--bg-accent);
    border-color: var(--border-accent);
    color: var(--text-accent);
}

.risk-field-item .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neutral-300);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.risk-field-item.collected .indicator {
    background: var(--otp-green-light);
    box-shadow: 0 0 10px var(--otp-green-light);
}

/* === Research Card === */
.research-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.research-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.research-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.research-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.research-btn:not(:disabled):hover {
    background: var(--bg-accent);
    border-color: var(--otp-green);
    color: var(--text-accent);
    transform: scale(1.02);
}

.research-btn svg {
    width: 18px;
    height: 18px;
}

.research-btn svg.spin {
    animation: spin 1s linear infinite;
}

.research-result {
    padding: var(--space-4);
    background: var(--bg-accent);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    animation: fadeIn 0.4s var(--ease-out-expo);
}

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

.result-content {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* === Chat Panel === */
.chat-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

/* Message Styles */
.message {
    display: flex;
    gap: var(--space-3);
    max-width: 85%;
    animation: messageSlide 0.5s var(--ease-out-expo);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--border-primary);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-light) 100%);
    border-color: var(--otp-green);
}

.message.assistant .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message.user .message-avatar {
    color: var(--text-secondary);
}

.message-avatar svg {
    width: 18px;
    height: 18px;
}

.message-content {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-xl);
    font-size: 0.95rem;
    line-height: 1.7;
}

.message.assistant .message-content {
    background: var(--bg-tertiary);
    border-bottom-left-radius: var(--radius-sm);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-dark) 100%);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.message-content p {
    margin: 0;
}

.message-content p + p {
    margin-top: var(--space-2);
}

/* Filler Message */
.message.filler .message-content {
    background: var(--bg-accent);
    border: 2px dashed var(--border-accent);
    font-style: italic;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: var(--space-4) var(--space-5);
    align-items: center;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    background: var(--otp-green);
    border-radius: 50%;
    animation: typingPulse 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* === Chat Input Area === */
.chat-input-area {
    padding: var(--space-4);
    border-top: 1px solid var(--border-secondary);
    background: var(--bg-elevated);
}

/* Voice Mode */
.voice-mode {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2);
}

.voice-mode.hidden {
    display: none;
}

.mode-switch-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-switch-btn:hover {
    background: var(--bg-accent);
    border-color: var(--border-accent);
    color: var(--text-accent);
    transform: scale(1.05);
}

.mode-switch-btn svg {
    width: 22px;
    height: 22px;
}

.voice-center-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
}

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

.status-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.voice-visualizer {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 48px;
}

.voice-visualizer.active {
    display: flex;
}

.voice-visualizer.active + .voice-status {
    display: none;
}

.voice-visualizer span {
    width: 5px;
    background: linear-gradient(180deg, var(--otp-green-light) 0%, var(--otp-green-dark) 100%);
    border-radius: 3px;
    animation: visualize 0.6s ease-in-out infinite;
}

.voice-visualizer span:nth-child(1) { height: 12px; animation-delay: -0.5s; }
.voice-visualizer span:nth-child(2) { height: 20px; animation-delay: -0.4s; }
.voice-visualizer span:nth-child(3) { height: 28px; animation-delay: -0.3s; }
.voice-visualizer span:nth-child(4) { height: 36px; animation-delay: -0.2s; }
.voice-visualizer span:nth-child(5) { height: 44px; animation-delay: -0.1s; }
.voice-visualizer span:nth-child(6) { height: 36px; animation-delay: 0s; }
.voice-visualizer span:nth-child(7) { height: 28px; animation-delay: 0.1s; }
.voice-visualizer span:nth-child(8) { height: 20px; animation-delay: 0.2s; }
.voice-visualizer span:nth-child(9) { height: 12px; animation-delay: 0.3s; }

@keyframes visualize {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1.2); }
}

.voice-button {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.voice-btn-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-light) 100%);
    opacity: 0.3;
    transform: scale(1);
    transition: all var(--transition-fast);
}

.voice-btn-inner {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 135, 82, 0.4);
    transition: all var(--transition-fast);
}

.voice-btn-inner svg {
    width: 28px;
    height: 28px;
}

.voice-button:hover .voice-btn-pulse {
    transform: scale(1.15);
    opacity: 0.4;
}

.voice-button:hover .voice-btn-inner {
    box-shadow: 0 6px 30px rgba(0, 135, 82, 0.5);
}

.voice-button.recording .voice-btn-pulse {
    animation: recordingPulse 1.5s ease-in-out infinite;
}

.voice-button.recording .voice-btn-inner {
    background: linear-gradient(135deg, var(--otp-green-light) 0%, var(--otp-green-bright) 100%);
}

@keyframes recordingPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.3); opacity: 0.1; }
}

/* Text Mode */
.text-mode {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.text-mode.hidden {
    display: none;
}

.text-input-container {
    flex: 1;
}

.text-input-container input {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.text-input-container input::placeholder {
    color: var(--text-tertiary);
}

.text-input-container input:focus {
    border-color: var(--otp-green);
    box-shadow: 0 0 0 4px rgba(0, 135, 82, 0.15);
}

.send-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(0, 135, 82, 0.3);
}

.send-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 135, 82, 0.4);
}

.send-button:disabled {
    background: var(--neutral-300);
    cursor: not-allowed;
    box-shadow: none;
}

.send-button svg {
    width: 22px;
    height: 22px;
}

/* === Credit Offer Modal === */
.offer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 30, 20, 0.9);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--space-4);
}

.offer-overlay.hidden {
    display: none;
}

.offer-modal {
    position: relative;
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: offerBounce 0.7s var(--ease-out-back);
}

@keyframes offerBounce {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.offer-celebration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-container {
    position: absolute;
    inset: 0;
}

.celebration-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring {
    position: absolute;
    border: 2px solid var(--otp-green-light);
    border-radius: 50%;
    opacity: 0;
    animation: ringExpand 2s ease-out infinite;
}

.ring-1 {
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
    animation-delay: 0s;
}

.ring-2 {
    width: 200px;
    height: 200px;
    margin: -100px 0 0 -100px;
    animation-delay: 0.4s;
}

.ring-3 {
    width: 300px;
    height: 300px;
    margin: -150px 0 0 -150px;
    animation-delay: 0.8s;
}

@keyframes ringExpand {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

.offer-content {
    position: relative;
    padding: var(--space-10);
    text-align: center;
    z-index: 1;
}

.offer-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto var(--space-5);
    background: linear-gradient(135deg, var(--success) 0%, #34D399 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: iconPop 0.6s var(--ease-out-back) 0.3s both;
}

@keyframes iconPop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.offer-icon svg {
    width: 44px;
    height: 44px;
}

.offer-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
    background: linear-gradient(135deg, var(--otp-green-dark) 0%, var(--otp-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.offer-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-8);
}

.offer-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.offer-card {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    animation: cardSlide 0.5s var(--ease-out-expo) both;
}

.offer-card:nth-child(1) { animation-delay: 0.4s; }
.offer-card:nth-child(2) { animation-delay: 0.5s; }

@keyframes cardSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
}

.offer-card.primary {
    background: linear-gradient(135deg, rgba(0, 135, 82, 0.15) 0%, rgba(82, 174, 48, 0.1) 100%);
    border: 2px solid var(--otp-green);
}

.offer-card.secondary {
    background: linear-gradient(135deg, rgba(82, 174, 48, 0.1) 0%, rgba(123, 193, 68, 0.05) 100%);
    border: 2px solid var(--otp-green-light);
}

.offer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 600;
}

.card-icon-small {
    width: 32px;
    height: 32px;
    background: var(--bg-accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-accent);
}

.card-icon-small svg {
    width: 16px;
    height: 16px;
}

.offer-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-2);
}

.amount-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--otp-green);
}

.offer-card.secondary .amount-value {
    color: var(--otp-green-light);
}

.amount-currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.offer-actions {
    display: flex;
    gap: var(--space-3);
}

.offer-btn {
    flex: 1;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.offer-btn.secondary {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    color: var(--text-primary);
}

.offer-btn.secondary:hover {
    background: var(--bg-accent);
    border-color: var(--border-accent);
}

.offer-btn.primary {
    background: linear-gradient(135deg, var(--otp-green) 0%, var(--otp-green-dark) 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 135, 82, 0.4);
}

.offer-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 135, 82, 0.5);
}

.offer-disclaimer {
    margin-top: var(--space-4);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* === Utility Classes === */
.hidden {
    display: none !important;
}

/* === Responsive Design === */
@media (max-width: 1200px) {
    :root {
        --panel-width: 340px;
    }
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    
    .dashboard-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-3);
    }
    
    .card {
        flex: 1 1 300px;
        min-width: 280px;
    }
    
    .chat-panel {
        flex: 1;
        min-height: 400px;
    }
    
    .animated-bg {
        display: none;
    }
}

@media (max-width: 600px) {
    .app-header {
        padding: 0 var(--space-4);
    }
    
    .brand-separator,
    .brand-desc {
        display: none;
    }
    
    .main-content {
        padding: var(--space-3);
    }
    
    .message {
        max-width: 92%;
    }
    
    .dashboard-panel {
        flex-direction: column;
    }
    
    .card {
        flex: none;
        min-width: 100%;
    }
    
    .modal-card {
        margin: var(--space-2);
    }
    
    .modal-hero {
        height: 160px;
    }
    
    .avatar-image {
        width: 100px;
        height: 100px;
    }
    
    .offer-actions {
        flex-direction: column;
    }
}
