:root {
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-focus: #6366f1;
    --success: #10b981;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="purple"] {
    --accent-primary: #a855f7;
    --accent-secondary: #ec4899;
    --input-focus: #a855f7;
}

[data-theme="emerald"] {
    --accent-primary: #10b981;
    --accent-secondary: #06b6d4;
    --input-focus: #10b981;
}

[data-theme="sunset"] {
    --accent-primary: #f59e0b;
    --accent-secondary: #ef4444;
    --input-focus: #f59e0b;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* --- Animated Background --- */
.background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
    animation-duration: 25s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-primary);
    top: 50%;
    left: 60%;
    opacity: 0.3;
    animation-delay: -10s;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* --- Login Card --- */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 1;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
    animation: slideUp 0.8s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* --- Form Elements --- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding-left: 4px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 12px;
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

.forgot-link:hover {
    filter: brightness(1.2);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 16px 14px 44px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.input-wrapper .icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.toggle-password {
    left: auto !important;
    right: 14px;
    cursor: pointer;
    pointer-events: auto !important;
}

.form-options {
    display: flex;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    background: var(--input-bg);
    position: relative;
    transition: var(--transition);
}

.checkbox-container input:checked+.checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked+.checkmark::after {
    display: block;
}

.submit-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

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

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

.card-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

/* --- Success State --- */
.success-message {
    text-align: center;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

/* --- Theme Controls --- */
.theme-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.theme-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.theme-btn:hover {
    transform: scale(1.3);
}

.theme-btn[data-theme="blue"] {
    background: #6366f1;
}

.theme-btn[data-theme="purple"] {
    background: #a855f7;
}

.theme-btn[data-theme="emerald"] {
    background: #10b981;
}

.theme-btn[data-theme="sunset"] {
    background: #f59e0b;
}

.theme-btn.active {
    border-color: white;
    transform: scale(1.3);
}

/* --- Loader --- */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
}
