:root {
    --bg: #0f1419;
    --card-bg: #1a1f26;
    --text-primary: #e8eaed;
    --text-secondary: #9ca3af;
    --accent: #3b82f6;
    --success: #10b981;
    --border: #2d3748;
    --error: #ef4444;
}

[data-theme="light"] {
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --accent: #2563eb;
    --success: #059669;
    --border: #e5e7eb;
    --error: #dc2626;
}

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

body {
    background: var(--bg);
    background-image: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 50%),
        radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.06), transparent 50%);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

.authWrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.authThemeToggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
}

.authThemeToggle .icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.authThemeToggle .iconMoon {
    display: none;
}

[data-theme="light"] .authThemeToggle .iconSun {
    display: none;
}

[data-theme="light"] .authThemeToggle .iconMoon {
    display: block;
}

.passwordToggleButton .icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    display: block;
}

.passwordToggleButton .icon[hidden] {
    display: none;
}

.authCard {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: authCardEnter 0.35s ease;
}

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

.authLogo {
    display: block;
    height: 40px;
    max-width: 220px;
    object-fit: contain;
    margin: 0 auto 16px;
}

.authTitle {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: var(--accent);
}

.authSubtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
    margin-bottom: 28px;
}

.authForm {
    display: flex;
    flex-direction: column;
}

.formGroup {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

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

.authForgotLink {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
}

.authForgotLink:hover {
    text-decoration: underline;
}

.formGroup input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 16px;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.formGroup input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.passwordFieldWrapper {
    position: relative;
    display: flex;
}

.passwordFieldWrapper input {
    padding-right: 44px;
}

.passwordToggleButton {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}

.passwordToggleButton:hover {
    color: var(--text-primary);
    background: rgba(37, 99, 235, 0.08);
}

.passwordToggleButton .icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.formError {
    color: var(--error);
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
}

.formSuccess {
    color: var(--success);
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.authButton {
    width: 100%;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
    min-height: 46px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.authButton:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.authButton:active {
    transform: translateY(0);
}

.authButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.authFooterLink a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.authFooterLink a:hover {
    text-decoration: underline;
}

@media (min-width: 480px) {
    .authCard {
        padding: 40px 32px;
    }
}
