/* Professional Trading Platform Login Styles - Matches Landing Page */
/* Based on designs from Coinbase Pro, Binance, Kraken, Interactive Brokers */

/* Import Design System from Landing Page */
:root {
    /* Primary Colors - Matching Landing Page */
    --primary-blue: #0052ff;
    --primary-blue-dark: #0041cc;
    --primary-blue-light: #1a73ff;
    
    /* Secondary Colors */
    --secondary-purple: #6366f1;
    --secondary-teal: #06b6d4;
    --secondary-green: #10b981;
    --secondary-orange: #f59e0b;
    
    /* Neutral Colors */
    --neutral-900: #0f172a;
    --neutral-800: #1e293b;
    --neutral-700: #334155;
    --neutral-600: #475569;
    --neutral-500: #64748b;
    --neutral-400: #94a3b8;
    --neutral-300: #cbd5e1;
    --neutral-200: #e2e8f0;
    --neutral-100: #f1f5f9;
    --neutral-50: #f8fafc;
    --white: #ffffff;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', sans-serif;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* 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 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--neutral-800);
    background-color: var(--neutral-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Navigation Bar */
.login-navbar {
    background: var(--white);
    border-bottom: 1px solid var(--neutral-200);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-xl);
    color: var(--neutral-900);
    text-decoration: none;
}

.logo i {
    font-size: var(--text-2xl);
    color: var(--primary-blue);
}

.nav-link {
    color: var(--neutral-600);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-blue);
}

/* Main Login Container */
.login-main {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    padding: var(--space-8) 0;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-16);
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* Login Card */
.login-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8);
    border: 1px solid var(--neutral-200);
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.login-header h1 {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-2);
}

.login-header p {
    font-size: var(--text-lg);
    color: var(--neutral-600);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: var(--neutral-100);
    border-radius: var(--radius-lg);
    padding: var(--space-1);
    margin-bottom: var(--space-8);
}

.tab-btn {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--neutral-600);
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) {
    color: var(--neutral-800);
}

/* Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--neutral-700);
    margin-bottom: var(--space-2);
}

/* Input Fields */
.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-family: var(--font-primary);
    background: var(--white);
    color: var(--neutral-900);
    transition: var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.1);
}

.form-input::placeholder {
    color: var(--neutral-400);
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password Field */
.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--neutral-400);
    cursor: pointer;
    padding: var(--space-2);
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--neutral-600);
}

/* Password Strength */
.password-strength {
    margin-top: var(--space-2);
}

.strength-bar {
    height: 4px;
    background: var(--neutral-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--space-1);
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: var(--transition-normal);
    border-radius: 2px;
}

.strength-fill.weak {
    width: 25%;
    background: var(--error);
}

.strength-fill.fair {
    width: 50%;
    background: var(--warning);
}

.strength-fill.good {
    width: 75%;
    background: var(--secondary-teal);
}

.strength-fill.strong {
    width: 100%;
    background: var(--success);
}

.strength-text {
    font-size: var(--text-xs);
    color: var(--neutral-500);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--neutral-600);
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    position: relative;
    transition: var(--transition-fast);
}

.checkbox-container input[type="checkbox"]:checked {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox-container input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkmark {
    /* Remove old checkmark styles */
    display: none;
}

/* Links */
.forgot-link,
.terms-link,
.back-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    transition: var(--transition-fast);
}

.forgot-link:hover,
.terms-link:hover,
.back-link:hover {
    text-decoration: underline;
}

/* Buttons - Matching Landing Page Design */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    outline: none;
}

.btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-social {
    background: var(--white);
    color: var(--neutral-700);
    border: 2px solid var(--neutral-200);
    flex: 1;
}

.btn-social:hover:not(:disabled) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
    margin-bottom: var(--space-6);
}

/* Button Loading State */
.btn.loading {
    pointer-events: none;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: var(--space-6) 0;
    color: var(--neutral-500);
    font-size: var(--text-sm);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--neutral-200);
}

.divider span {
    padding: 0 var(--space-4);
}

/* Social Login */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.social-login .btn i {
    font-size: var(--text-lg);
}

/* Form Footer */
.form-footer {
    text-align: center;
    padding-top: var(--space-4);
}

/* OTP Verification */
.otp-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.otp-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
}

.otp-icon i {
    font-size: var(--text-2xl);
    color: var(--white);
}

.otp-header h3 {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: var(--space-2);
}

.otp-header p {
    color: var(--neutral-600);
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.otp-digit {
    width: 48px;
    height: 48px;
    text-align: center;
    font-size: var(--text-xl);
    font-weight: 600;
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    color: var(--neutral-900);
    transition: var(--transition-fast);
    outline: none;
}

.otp-digit:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.1);
}

.otp-digit.filled {
    border-color: var(--success);
    background: var(--success-light);
}

.otp-footer {
    text-align: center;
    margin-top: var(--space-4);
}

.resend-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.resend-btn:disabled {
    color: var(--neutral-400);
    cursor: not-allowed;
    text-decoration: none;
}

/* Login Sidebar */
.login-sidebar {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    color: var(--white);
}

/* Features will have margin-bottom spacing automatically */

.feature-highlight {
    margin-bottom: var(--space-8);
}

.feature-highlight:last-child {
    margin-bottom: 0;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.feature-icon i {
    font-size: var(--text-xl);
    color: var(--white);
}

.feature-highlight h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.feature-highlight p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 1000;
    max-width: 400px;
}

.toast {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--primary-blue);
    transform: translateX(100%);
    opacity: 0;
    transition: var(--transition-normal);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

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

.toast-title {
    font-weight: 600;
    color: var(--neutral-900);
}

.toast-close {
    background: none;
    border: none;
    color: var(--neutral-400);
    cursor: pointer;
    font-size: var(--text-lg);
    padding: 0;
}

.toast-message {
    color: var(--neutral-600);
    font-size: var(--text-sm);
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: var(--transition-normal);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
}

.modal-icon.success {
    background: var(--success);
}

.modal-icon i {
    font-size: var(--text-2xl);
    color: var(--white);
}

.modal-content h3 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-3);
}

.modal-content p {
    color: var(--neutral-600);
    margin-bottom: var(--space-6);
}

/* reCAPTCHA Container */
#recaptcha-container {
    margin: var(--space-4) 0;
    display: flex;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .login-wrapper {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .login-sidebar {
        order: -1;
        padding: var(--space-6);
    }
    
    .feature-highlight {
        margin-bottom: var(--space-6);
    }
    
    .login-card {
        padding: var(--space-6);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .social-login {
        grid-template-columns: 1fr;
    }
    
    .otp-inputs {
        gap: var(--space-2);
    }
    
    .otp-digit {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: var(--space-4);
    }
    
    .login-header h1 {
        font-size: var(--text-2xl);
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
    }
    
    .feature-icon i {
        font-size: var(--text-lg);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --neutral-200: #000000;
        --neutral-300: #000000;
        --neutral-400: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
