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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
    --border: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    position: relative;
    z-index: 10;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: var(--primary-color);
}

.logo svg {
    width: 100%;
    height: 100%;
}

h1 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-button {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-spinner {
    width: 20px;
    height: 20px;
}

.button-spinner svg {
    width: 100%;
    height: 100%;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Background animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary-light);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-light);
    animation: twinkle 3s infinite;
}

.star:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.star:nth-child(2) {
    top: 40%;
    left: 60%;
    animation-delay: 0.5s;
}

.star:nth-child(3) {
    top: 60%;
    left: 30%;
    animation-delay: 1s;
}

.star:nth-child(4) {
    top: 80%;
    left: 70%;
    animation-delay: 1.5s;
}

.star:nth-child(5) {
    top: 30%;
    left: 80%;
    animation-delay: 2s;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
        margin: 20px;
    }

    h1 {
        font-size: 28px;
    }
}
