:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --surface: rgba(20, 20, 30, 0.6);
    --surface-glass: rgba(30, 30, 45, 0.4);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 245, 255, 0.4);
    --text-primary: #f0f0f5;
    --text-secondary: #9898b3;
    --text-muted: #6868a0;
    --accent-primary: #00f5ff;
    --accent-secondary: #7b2ff7;
    --accent-gradient: linear-gradient(135deg, #00f5ff 0%, #7b2ff7 100%);
    --shadow-primary: 0 8px 32px rgba(0, 245, 255, 0.1);
    --shadow-glow: 0 0 40px rgba(0, 245, 255, 0.15);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #00f5ff 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #7b2ff7 0%, transparent 70%);
    bottom: -15%;
    right: -5%;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #ff006e 0%, transparent 70%);
    top: 40%;
    right: 10%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 30px) scale(0.9);
    }
}

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.05"/></svg>');
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    padding: 20px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px 40px;
    position: relative;
    box-shadow: var(--shadow-primary),
                0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card:hover {
    border-color: rgba(0, 245, 255, 0.2);
    box-shadow: var(--shadow-glow),
                0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.glow-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 245, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.login-card:hover .glow-effect {
    opacity: 1;
}

.logo-section {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    animation: rotate3d 20s linear infinite;
}

@keyframes rotate3d {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(0, 245, 255, 0.3));
}

.brand-name {
    font-family: 'Orbitron', monospace;
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 2px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 0, 68, 0.1);
    border: 1px solid rgba(255, 0, 68, 0.3);
    border-radius: 12px;
    color: #ff4757;
    font-size: 14px;
    margin-bottom: 24px;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.error-message svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@keyframes shake {
    10%, 90% {
        transform: translateX(-1px);
    }
    20%, 80% {
        transform: translateX(2px);
    }
    30%, 50%, 70% {
        transform: translateX(-4px);
    }
    40%, 60% {
        transform: translateX(4px);
    }
}

.login-form {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: rgba(15, 15, 25, 0.6);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    backdrop-filter: blur(10px);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.input-wrapper input:focus {
    border-color: var(--border-focus);
    background: rgba(15, 15, 25, 0.8);
}

.input-wrapper input:focus ~ .input-glow {
    opacity: 1;
}

.input-wrapper input:focus ~ .input-icon {
    color: var(--accent-primary);
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: var(--accent-gradient);
    opacity: 0;
    filter: blur(12px);
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.form-options {
    margin-bottom: 32px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s backwards;
}

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

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(15, 15, 25, 0.6);
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom {
    border-color: var(--accent-primary);
    background: rgba(0, 245, 255, 0.1);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.submit-btn {
    width: 100%;
    padding: 18px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--bg-primary);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 245, 255, 0.25);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s backwards;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 245, 255, 0.35);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-icon {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.submit-btn:hover .btn-glow {
    width: 100%;
}

.footer-text {
    margin-top: 32px;
    text-align: center;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards;
}

.footer-text p {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-text p::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
}

.security-badge {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    z-index: 10;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s backwards;
}

.security-badge svg {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.4));
}

@media (max-width: 600px) {
    .container {
        padding: 16px;
    }

    .login-card {
        padding: 36px 28px;
    }

    .brand-name {
        font-size: 32px;
    }

    .security-badge {
        bottom: 20px;
        right: 20px;
        font-size: 12px;
        padding: 10px 16px;
    }
}

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