/* HAMAL Investment Management System - Auth Styles */

:root {
    --primary: #d4a017;
    --primary-dark: #b8860b;
    --primary-light: #f4c542;
    --secondary: #6c5ce7;
    --dark: #0a0e17;
    --dark-secondary: #1a1f2e;
    --dark-tertiary: #252a3d;
    --silver: #b8c0cc;
    --silver-light: #dfe4ea;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --success: #00d4aa;
    --warning: #fdcb6e;
    --danger: #ff6b6b;
    --info: #74b9ff;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.2);
    
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.auth-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Animated Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.auth-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
}

.geometric-shapes {
    width: 100%;
    height: 100%;
    position: relative;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--info);
    top: 50%;
    left: 10%;
    animation-delay: -10s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    background: var(--warning);
    bottom: 20%;
    right: 15%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(30px, -30px) rotate(90deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg);
    }
    75% {
        transform: translate(20px, 30px) rotate(270deg);
    }
}

/* Auth Container */
.auth-main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    margin: auto 0;
}

.auth-container {
    width: 100%;
}

.auth-card {
    background: var(--dark-secondary);
    border: 1px solid rgba(184, 192, 204, 0.1);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    margin-bottom: 24px;
}

.auth-logo-img {
    max-width: 100%;
    height: auto;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--silver);
    font-weight: 400;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--silver-light);
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--dark-tertiary);
    border: 1px solid rgba(184, 192, 204, 0.15);
    border-radius: var(--radius);
    color: var(--white);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
    background: var(--dark);
}

.form-input::placeholder {
    color: var(--gray-600);
}

.form-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-600);
    font-size: 1.1rem;
    transition: color var(--transition);
    pointer-events: none;
}

.form-input:focus + .form-input-icon,
.form-input-wrapper:focus-within .form-input-icon {
    color: var(--primary);
}

.form-input-error {
    border-color: var(--danger) !important;
}

.error-message {
    font-size: 0.8rem;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    transition: color var(--transition);
}

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

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(184, 192, 204, 0.3);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: var(--dark);
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-input:checked + .checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-input:focus + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.2);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--silver);
    user-select: none;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.checkbox-label a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Buttons */
.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--dark);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 170, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--dark);
}

.btn-ghost {
    background: transparent;
    color: var(--silver);
    border: none;
    padding: 12px;
}

.btn-ghost:hover {
    color: var(--white);
    background: rgba(184, 192, 204, 0.08);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(184, 192, 204, 0.15);
}

.divider-text {
    font-size: 0.8rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Social Login */
.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--dark-tertiary);
    border: 1px solid rgba(184, 192, 204, 0.15);
    border-radius: var(--radius);
    color: var(--silver-light);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-social:hover {
    background: var(--dark);
    border-color: rgba(184, 192, 204, 0.3);
    color: var(--white);
}

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

/* Auth Footer */
.auth-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(184, 192, 204, 0.1);
    text-align: center;
}

.auth-footer p {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 2FA Specific */
.auth-2fa-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--dark);
}

.qr-code-container {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.qr-code-container img {
    width: 200px;
    height: 200px;
    border-radius: var(--radius);
    background: var(--white);
    padding: 16px;
}

.recovery-codes {
    background: var(--dark-tertiary);
    border: 1px solid rgba(184, 192, 204, 0.1);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 24px;
}

.recovery-codes-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--silver-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recovery-codes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.recovery-code {
    background: var(--dark);
    border: 1px solid rgba(184, 192, 204, 0.1);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: 'Monospace', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    text-align: center;
    letter-spacing: 0.1em;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
    }
    
    .social-buttons {
        grid-template-columns: 1fr;
    }
    
    .recovery-codes-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Input Animation */
.form-input-wrapper {
    animation: slideUp 0.4s ease backwards;
}

.form-input-wrapper:nth-child(1) { animation-delay: 0.1s; }
.form-input-wrapper:nth-child(2) { animation-delay: 0.15s; }
.form-input-wrapper:nth-child(3) { animation-delay: 0.2s; }
.form-input-wrapper:nth-child(4) { animation-delay: 0.25s; }
.form-input-wrapper:nth-child(5) { animation-delay: 0.3s; }
.form-input-wrapper:nth-child(6) { animation-delay: 0.35s; }

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