/* ============================================
   Dashboard Login Page - Refined Dark Theme
   ============================================ */

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

:root {
    /* Modern Trading Dashboard - Green & Black Theme */
    --primary-gradient-start: #FFB21E;
    --primary-gradient-end: #FF8A1D;
    --background-dark: #181b27;
    --background-secondary: #181b27;
    --card-bg: rgba(24, 27, 39, 0.95);
    --card-border: rgba(255, 178, 30, 0.2);
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --input-bg: rgba(24, 27, 39, 0.8);
    --input-border: rgba(255, 178, 30, 0.2);
    --input-focus-border: #FFB21E;
    --error-color: #FF4444;
    --success-color: #FFB21E;
    --link-color: #FFB21E;
    --link-hover: #FF8A1D;
    --gold: #FFAA00;
    --green: #FFB21E;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.8);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.9);
    --shadow-lg: 0 8px 32px rgba(255, 178, 30, 0.4);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradient */
.login-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    overflow: hidden;
    padding-top: 8rem;
}

.background-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 178, 30, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 138, 29, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, var(--background-dark) 0%, var(--background-secondary) 100%);
    z-index: 0;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Logo Container */
.logo-container {
    position: absolute;
    top: 3.5rem;
    left: 2rem;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.3));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Login Header (Centered) */
.login-header {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 440px;
    animation: cardFadeIn 0.6s ease-out;
}

/* Login Card */
.login-card {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    animation: cardFadeIn 0.8s ease-out;
}

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

.card-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Welcome Section */
.welcome-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.5px;
    text-align: center;
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 400;
    text-align: center;
    opacity: 0.9;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
    transition: var(--transition);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-input:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15), 0 4px 12px rgba(147, 51, 234, 0.1);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.form-input:focus + .input-icon,
.form-input:not(:placeholder-shown) + .input-icon {
    color: var(--input-focus-border);
}

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

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

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

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

.eye-icon {
    width: 20px;
    height: 20px;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-gradient-start);
}

.checkbox-label {
    color: var(--text-secondary);
    font-weight: 400;
}

.forgot-password-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Alert Messages */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    animation: slideDown 0.3s ease-out;
}

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

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-color);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Login Button */
.login-button {
    position: relative;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.3);
    margin-top: 0.5rem;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(147, 51, 234, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    display: none;
    animation: spin 1s linear infinite;
}

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

.login-button.loading .button-text {
    opacity: 0;
}

.login-button.loading .button-loader {
    display: block;
}

/* Sign Up Link */
.signup-link {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.signup-text {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.signup-link-text {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.signup-link-text:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Dashboard Access Button */
.dashboard-access {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.dashboard-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--primary-gradient-start);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dashboard-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.2), transparent);
    transition: left 0.5s;
}

.dashboard-button:hover::before {
    left: 100%;
}

.dashboard-button:hover {
    background: rgba(147, 51, 234, 0.1);
    border-color: var(--primary-gradient-end);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.3);
}

.dashboard-button i {
    font-size: 1.125rem;
}

.dashboard-button span {
    position: relative;
    z-index: 1;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    padding: 0.875rem 1.25rem;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 4px 24px rgba(59, 130, 246, 0.6);
    }
}

.chat-widget:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}

.chat-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-icon svg {
    width: 100%;
    height: 100%;
    fill: white;
}

.chat-text {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .login-container {
        padding: 1rem;
        padding-top: 6rem;
    }

    .logo-container {
        top: 2rem;
        left: 1rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .login-header {
        margin-bottom: 2rem;
    }

    .welcome-title {
        font-size: 1.75rem;
    }

    .welcome-subtitle {
        font-size: 0.9rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .chat-widget {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1rem;
    }

    .chat-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .forgot-password-link {
        align-self: flex-end;
    }
}

/* Loading State */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* Focus visible for keyboard navigation */
.form-input:focus-visible,
.login-button:focus-visible,
.password-toggle:focus-visible {
    outline: 2px solid var(--input-focus-border);
    outline-offset: 2px;
}

