:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e1e8ed;
    --accent: #667eea;
    --accent-hover: #5568d3;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-gradient-start: #7c8efc;
    --bg-gradient-end: #8a5fb8;
    --text-primary: #fafbfc;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --border-color: #404040;
    --accent: #7c8efc;
    --accent-hover: #8b9dfd;
    --success-bg: #1e3a28;
    --success-text: #7fd99a;
    --success-border: #2d5640;
    --error-bg: #3a1e22;
    --error-text: #f69b9b;
    --error-border: #5c2e34;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background 0.3s ease;
    padding: 2rem 1rem;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: white;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
}

.container {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px var(--shadow-lg);
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.logo-icon svg {
    width: 32px;
    height: 32px;
    stroke: white;
}

.logo h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

button {
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow);
}

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

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.message.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.message.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.info p {
    margin-bottom: 0.25rem;
}

.footer {
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s ease;
}

.footer a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 640px) {
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        padding: 0.4rem 0.8rem;
    }

    .container {
        padding: 2rem;
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .footer {
        bottom: 1rem;
        font-size: 0.75rem;
    }
}
