@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Nunito:wght@300;400;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --accent: #22c55e;
    --accent-dark: #16a34a;
    --bg-dark: #0f0e1a;
    --bg-card: #1a1830;
    --bg-input: #231f3a;
    --text-main: #f1f0ff;
    --text-muted: #9ca3af;
    --border: #2e2b4a;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
}

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

body {
    background: var(--bg-dark);
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(79,70,229,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(245,158,11,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(129,140,248,0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Floating particles */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0.4;
    animation: float linear infinite;
}
@keyframes float {
    from { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.4; }
    90%  { opacity: 0.4; }
    to   { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

.container {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    padding: 48px 40px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow:
        0 25px 60px rgba(0,0,0,0.5),
        0 0 0 1px rgba(79,70,229,0.1),
        inset 0 1px 0 rgba(255,255,255,0.05);
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

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

.logo-area {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(79,70,229,0.4);
    overflow: hidden;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; padding: 8px; display: block; }

h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-main);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 14px 44px 14px 44px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-main);
    font-family: 'Nunito', sans-serif;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: #201d35;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.2);
}

input.valid { border-color: var(--success) !important; }
input.invalid { border-color: var(--error) !important; }

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
}

.input-status {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
    transition: opacity 0.2s;
}
.password-toggle + .input-status {
    right: 48px;
}
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}
.password-toggle:hover,
.password-toggle:focus {
    color: var(--text-main);
    outline: none;
    background: rgba(255,255,255,0.06);
}
.input-status.ok    { color: var(--success); }
.input-status.fail  { color: var(--error); }

.field-hint {
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
    transition: color 0.2s;
}
.field-hint.ok   { color: var(--success); }
.field-hint.fail { color: var(--error); }
.field-hint.info { color: var(--text-muted); }

/* Password strength bar */
.strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin-top: 8px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}

button[type="submit"] {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

button[type="submit"]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79,70,229,0.45);
}
button[type="submit"]:hover::after { opacity: 1; }
button[type="submit"]:active { transform: translateY(0); }
button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }

.link {
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}
.forgot-link {
    margin-top: 14px;
}
.link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}
.link a:hover { color: var(--accent); }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 12px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Flash alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-error   { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: rgba(16,185,129,0.1); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }

/* Light Mode */
body.light-mode {
    --bg-dark: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --text-main: #111827;
    --text-muted: #64748b;
    --border: #94a3b8;
}

body.light-mode::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(34,197,94,0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(59,130,246,0.06) 0%, transparent 50%);
}

body.light-mode .container {
    box-shadow:
        0 18px 42px rgba(15,23,42,0.14),
        0 0 0 1px rgba(37,99,235,0.16);
}

body.light-mode input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

body.light-mode .alert-error {
    background: rgba(239,68,68,0.08);
    color: #dc2626;
    border-color: rgba(239,68,68,0.2);
}

body.light-mode .alert-success {
    background: rgba(34,197,94,0.08);
    color: #16a34a;
    border-color: rgba(34,197,94,0.2);
}
