/* ==================================================
   ECOMNIGHTHQ — LOGIN PAGE STYLESHEET
   Premium Design System Matching Main Site
   ================================================== */

:root {
    --font-display: 'Clash Display', sans-serif;
    --font-body: 'Satoshi', sans-serif;
    --font-mono: 'Inter Tight', monospace;
    --nav-height: 80px;
    --ticker-height: 34px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    --bg-void: #000000;
    --bg-surface: rgba(8, 8, 12, 0.85);
    --bg-glass: rgba(12, 12, 16, 0.5);
    --bg-glass-hover: rgba(18, 18, 24, 0.6);
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0BC;
    --text-muted: #6B6B78;
    --accent: #4D7CFF;
    --accent-dim: rgba(77, 124, 255, 0.15);
    --accent-glow: rgba(77, 124, 255, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.15);
    --green: #34D399;
    --green-dim: rgba(52, 211, 153, 0.1);
    --panel-bg: rgba(10, 10, 14, 0.9);
    --btn-primary-bg: #FFFFFF;
    --btn-primary-color: #000000;
    --input-bg: rgba(255, 255, 255, 0.03);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus-border: rgba(77, 124, 255, 0.6);
    --input-placeholder: #4a4a55;
    --error-color: #f87171;
    --logo-svg-color: #FFFFFF;
    --ticker-bg: rgba(5, 5, 8, 0.95);
    --metric-card-bg: rgba(255, 255, 255, 0.02);
    --btn-ghost-bg: rgba(255, 255, 255, 0.03);
    --btn-ghost-border: rgba(255, 255, 255, 0.1);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --bg-void: #F8F9FC;
    --bg-surface: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.85);
    --text-primary: #0F1419;
    --text-secondary: #536471;
    --text-muted: #8899A6;
    --accent: #2563EB;
    --accent-dim: rgba(37, 99, 235, 0.1);
    --accent-glow: rgba(37, 99, 235, 0.3);
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --green: #059669;
    --green-dim: rgba(5, 150, 105, 0.08);
    --panel-bg: rgba(255, 255, 255, 0.95);
    --btn-primary-bg: #0F1419;
    --btn-primary-color: #FFFFFF;
    --input-bg: rgba(0, 0, 0, 0.02);
    --input-border: rgba(0, 0, 0, 0.1);
    --input-focus-border: rgba(37, 99, 235, 0.5);
    --input-placeholder: #aab4be;
    --error-color: #dc2626;
    --logo-svg-color: #0F1419;
    --ticker-bg: rgba(255, 255, 255, 0.98);
    --metric-card-bg: rgba(0, 0, 0, 0.02);
    --btn-ghost-bg: rgba(0, 0, 0, 0.03);
    --btn-ghost-border: rgba(0, 0, 0, 0.1);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--bg-void); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; cursor: none; }
a { text-decoration: none; color: inherit; cursor: none; }
button { cursor: none; border: none; background: none; font-family: inherit; }
@media (max-width: 1024px) { body, a, button { cursor: auto; } }

/* ===== CUSTOM CURSOR ===== */
.custom-cursor { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99999; }
.cursor-dot { position: absolute; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; transform: translate(-50%, -50%); }
.cursor-ring { position: absolute; width: 36px; height: 36px; border: 1.5px solid var(--accent); border-radius: 50%; opacity: 0.5; transform: translate(-50%, -50%); transition: width 0.3s, height 0.3s, opacity 0.3s; }
@media (max-width: 1024px) { .custom-cursor { display: none; } }

/* ===== BACKGROUND ===== */
.bg-elements { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.bg-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--border-subtle) 1px, transparent 1px), linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px); background-size: 60px 60px; opacity: 0.3; }
.bg-glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.15; }
.bg-glow-1 { width: 600px; height: 600px; background: var(--accent); top: -200px; right: -200px; }
.bg-glow-2 { width: 500px; height: 500px; background: var(--green); bottom: -200px; left: -200px; opacity: 0.08; }

/* ===== CONTAINER ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 768px) { .container { padding: 0 20px; } }

/* ===== LOGIN MAIN ===== */
.login-main {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--ticker-height) + var(--nav-height));
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* ===== LOGIN SECTION ===== */
.login-section {
    width: 100%;
    padding: 60px 0 120px;
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== LOGIN CARD ===== */
.login-card {
    position: relative;
    width: 100%;
    max-width: 460px;
}

.login-card-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: var(--accent);
    filter: blur(150px);
    opacity: 0.07;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.login-card-inner {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 48px 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: border-color 0.3s ease;
}

.login-card-inner:hover {
    border-color: var(--border-hover);
}

@media (max-width: 520px) {
    .login-card-inner {
        padding: 36px 24px;
        border-radius: 20px;
    }
}

/* ===== LOGIN HEADER ===== */
.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent);
}

.login-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== LOGIN ALERT ===== */
.login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--error-color);
    font-size: 13px;
    margin-bottom: 8px;
    animation: alertSlideIn 0.3s var(--ease-out-expo);
}

.login-alert svg {
    flex-shrink: 0;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== FORM ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

[dir="rtl"] .form-label {
    text-align: right;
    display: block;
}

.required {
    color: var(--accent);
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

[dir="rtl"] .input-icon {
    left: auto;
    right: 14px;
}

.form-input {
    width: 100%;
    padding: 14px 14px 14px 42px;
    border-radius: 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
    -webkit-appearance: none;
}

[dir="rtl"] .form-input {
    padding: 14px 42px 14px 14px;
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .form-group:has(.password-toggle) .form-input {
    padding: 14px 42px 14px 42px;
}

.form-input::placeholder {
    color: var(--input-placeholder);
}

.form-input:focus {
    border-color: var(--input-focus-border);
    background: var(--bg-glass-hover);
    box-shadow: 0 0 0 3px rgba(77, 124, 255, 0.08);
}

.form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.08);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    padding: 0;
}

[dir="rtl"] .password-toggle {
    right: auto;
    left: 14px;
}

.password-toggle:hover {
    color: var(--accent);
}

.eye-icon {
    width: 18px;
    height: 18px;
}

/* Field Error */
.field-error {
    font-size: 12px;
    color: var(--error-color);
    display: none;
    padding-left: 2px;
}

.field-error.visible {
    display: block;
}

[dir="rtl"] .field-error {
    padding-left: 0;
    padding-right: 2px;
    text-align: right;
}

/* ===== SUBMIT BUTTON ===== */
.form-submit {
    width: 100%;
    padding: 16px 32px;
    border-radius: 14px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-color);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    border: none;
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.form-submit:active {
    transform: translateY(0);
}

.form-submit:disabled {
    opacity: 0.7;
    pointer-events: none;
}

.submit-loading .spin-icon {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s var(--ease-out-expo);
}

.form-submit:hover .btn-shine {
    left: 150%;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-surface);
    border: 1px solid var(--green);
    border-radius: 14px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s var(--ease-out-expo);
    backdrop-filter: blur(20px);
    min-width: 280px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 16px;
    height: 16px;
    color: var(--green);
}

.toast-content .toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.toast-content .toast-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== ANIMATIONS ===== */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s var(--ease-out-expo);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-3px);
}

@media (max-width: 1024px) {
    .back-to-top { cursor: pointer; }
}

/* ===== FOOTER ===== */
.premium-footer { position: relative; padding: 0 40px; }
.footer-divider { padding: 0 0 60px; }
.footer-divider-line { height: 1px; background: linear-gradient(90deg, transparent, var(--border-glass), var(--accent), var(--border-glass), transparent); }
@media (max-width: 768px) { .premium-footer { padding: 0 20px; } }