@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #3b82f6;
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-hover: #1f2937;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ===== ANIMATED ORBS ===== */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: orbFadeIn 2s ease forwards;
}

.orb-1 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, transparent 70%);
    top: -180px;
    left: -180px;
    animation: orbFadeIn 2s ease forwards, orbFloat1 18s ease-in-out infinite 2s;
}

.orb-2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    bottom: -120px;
    right: -120px;
    animation: orbFadeIn 2s ease 0.5s forwards, orbFloat2 22s ease-in-out infinite 2.5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.18) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFadeIn 2s ease 1s forwards, orbFloat3 26s ease-in-out infinite 3s;
}

@keyframes orbFadeIn {
    to { opacity: 1; }
}

@keyframes orbFloat1 {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(60px, 40px); }
    50%  { transform: translate(30px, 80px); }
    75%  { transform: translate(-40px, 50px); }
    100% { transform: translate(0, 0); }
}

@keyframes orbFloat2 {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-50px, -30px); }
    50%  { transform: translate(-80px, -60px); }
    75%  { transform: translate(-20px, -80px); }
    100% { transform: translate(0, 0); }
}

@keyframes orbFloat3 {
    0%   { transform: translate(-50%, -50%) scale(1); }
    33%  { transform: translate(calc(-50% + 80px), calc(-50% - 40px)) scale(1.1); }
    66%  { transform: translate(calc(-50% - 60px), calc(-50% + 60px)) scale(0.95); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* ===== FLOATING PARTICLES ===== */
.particles-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* ===== GRID PATTERN ===== */
.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    animation: gridDrift 30s linear infinite;
}

@keyframes gridDrift {
    from { background-position: 0 0; }
    to   { background-position: 40px 40px; }
}

/* ===== WRAPPER ===== */
.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    width: 100%;
    max-width: 460px;
}

/* ===== BRAND HEADER ===== */
.brand-header {
    text-align: center;
    animation: fadeDown 0.7s ease both;
}

.brand-header .brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.45);
    font-size: 1.6rem;
    color: white;
    position: relative;
}

.brand-header .brand-icon::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    pointer-events: none;
}

.brand-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    font-weight: 300;
}

/* ===== LOGIN CARD ===== */
.login-container {
    width: 100%;
    background: rgba(17, 24, 39, 0.9);
    padding: 2.5rem;
    border-radius: 1.75rem;
    border: 1px solid rgba(37, 99, 235, 0.18);
    backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03),
        0 30px 80px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.06);
    animation: fadeUp 0.8s ease 0.1s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== SECTION TITLE ===== */
.section-title {
    margin-bottom: 2rem;
}

.section-title h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.section-title span {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 300;
}

/* ===== ERROR ===== */
.error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

/* ===== FORM GROUP ===== */
.form-group {
    margin-bottom: 1.4rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ===== INPUT ===== */
.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: rgba(59, 130, 246, 0.6);
    font-size: 1rem;
    transition: color 0.3s;
    pointer-events: none;
}

.input-icon input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border-radius: 0.875rem;
    border: 1px solid rgba(59, 130, 246, 0.15);
    background: rgba(10, 14, 26, 0.8);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.25s ease;
}

.input-icon input::placeholder {
    color: rgba(148, 163, 184, 0.35);
}

.input-icon input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.6);
    background: rgba(10, 14, 26, 1);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 4px 16px rgba(0,0,0,0.2);
}

.input-icon input:focus + i,
.input-icon:focus-within i {
    color: var(--secondary-color);
}

/* ===== DIVIDER ===== */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.2), transparent);
    margin: 1.75rem 0;
}

/* ===== BUTTON ===== */
button[type="submit"] {
    width: 100%;
    padding: 0.9rem;
    border-radius: 0.875rem;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

button[type="submit"]:hover::before {
    left: 100%;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(37, 99, 235, 0.55);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button i {
    margin-right: 0.5rem;
}

/* ===== FOOTER ===== */
.login-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 300;
    animation: fadeUp 0.8s ease 0.3s both;
    opacity: 0.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .login-container {
        padding: 2rem 1.5rem;
        border-radius: 1.25rem;
    }

    .brand-header h1 {
        font-size: 1.4rem;
    }
}