:root {
    --bg: #050505;
    --bg2: #0a0a0a;
    --card: #0f0f12;
    --card2: #16161a;
    --border: rgba(0, 102, 255, 0.15);
    --border-hover: rgba(0, 102, 255, 0.4);
    --primary: #0066ff;
    --primary-light: #3385ff;
    --primary-dark: #0052cc;
    --primary-glow: rgba(0, 102, 255, 0.25);
    --accent: #ffffff;
    --text: #ffffff;
    --text-secondary: #f0f0f0;
    --muted: #a0a0a0;
    --danger: #ff4d4d;
    --danger-bg: rgba(255, 77, 77, 0.1);
    --success: #00e676;
    --success-bg: rgba(0, 230, 118, 0.1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp   { from { opacity:0; transform:translateY(28px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes float    { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-10px); } }
@keyframes pulse-glow { 0%,100% { opacity:.4; } 50% { opacity:.85; } }
@keyframes spin     { to { transform:rotate(360deg); } }
@keyframes shake    { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }

/* ─── BACKGROUND BLOBS ─── */
.bg-blobs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: pulse-glow 7s ease-in-out infinite;
}
.blob-1 { width:700px; height:700px; top:-20%; left:50%; transform:translateX(-50%); background:radial-gradient(circle,rgba(0, 102, 255,.14) 0%,transparent 70%); }
.blob-2 { width:380px; height:380px; bottom:5%; left:-8%; background:radial-gradient(circle,rgba(255, 255, 255,.05) 0%,transparent 70%); animation-delay:2s; }
.blob-3 { width:330px; height:330px; top:25%; right:-8%; background:radial-gradient(circle,rgba(0, 102, 255,.09) 0%,transparent 70%); animation-delay:1.2s; }
.grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(0, 102, 255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 255,.025) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* ─── NAVBAR ─── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 32px;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    animation: fadeIn .5s ease both;
}
.nav-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.3px;
}
.nav-logo img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 18px var(--primary-glow);
    transition: transform .3s;
}
.nav-logo:hover img { transform: scale(1.08); }
.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}
.nav-back:hover { color: var(--text); }
.nav-back svg { width:15px; height:15px; }

/* ─── MAIN WRAPPER ─── */
.page-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
    position: relative;
    z-index: 1;
}

/* ─── LOGIN CARD ─── */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(0, 102, 255,.06);
    animation: fadeUp .65s cubic-bezier(.22,1,.36,1) both .1s;
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-light), var(--primary));
    opacity: .8;
}

/* Logo block */
.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}
.login-logo img {
    width: 72px; height: 72px;
    object-fit: contain;
    box-shadow: 0 0 48px var(--primary-glow);
    animation: float 5s ease-in-out infinite;
    margin-bottom: 14px;
}
.login-logo h1 {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.5px;
    margin-bottom: 4px;
}
.login-logo p {
    font-size: 13px;
    color: var(--muted);
}

/* Form */
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.form-input-wrap {
    position: relative;
}
.form-input-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    transition: color .2s;
}
.form-input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.025);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    letter-spacing: .04em;
}
.form-input::placeholder { color: var(--muted); font-weight: 400; }
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246,.18);
}
.form-input:focus + svg,
.form-input-wrap:focus-within svg { color: var(--primary-light); }

/* Eye toggle */
.eye-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .2s;
}
.eye-toggle:hover { color: var(--text-secondary); }

/* Alert msgs */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 18px;
    animation: fadeUp .35s ease both;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error  { background: var(--danger-bg);  border: 1px solid rgba(239, 68, 68, .25);  color: #fca5a5; }
.alert-success{ background: var(--success-bg); border: 1px solid rgba(34,197,94,.25);  color: #86efac; }
.alert.shake  { animation: shake .35s ease, fadeUp .35s ease; }

/* Submit btn */
.btn-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .25s, box-shadow .25s;
    box-shadow: 0 4px 28px var(--primary-glow);
    letter-spacing: -.1px;
    margin-top: 6px;
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 48px rgba(59, 130, 246,.35);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}
.btn-submit .spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { display: none; }

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

/* Help links */
.help-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.help-link {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .2s;
}
.help-link:hover { color: var(--primary-light); }

/* Badge */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    font-size: 11px;
    color: var(--muted);
}
.security-badge svg { color: var(--primary); }

/* ─── FOOTER ─── */
footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 20px 32px;
    background: var(--bg2);
}
.foot-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a, footer p {
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}
.foot-links a:hover { color: var(--text-secondary); }

/* ─── RESPONSIVE ─── */
@media (max-width: 500px) {
    .login-card { padding: 32px 22px; }
    .nav { padding: 0 18px; }
}
