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

:root {
    /* Primary Colors - MUST match workload-tracker */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    /* Background Colors */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Border */
    --border: #475569;
    
    /* Status Colors */
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    
    /* Border Radius - matching workload-tracker */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Shadow */
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Auth pages only - centered layout */
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: 
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(99, 102, 241, 0.05), transparent 50%);
}

/* Dashboard pages - full layout */
body.dashboard-page {
    background-image: 
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(99, 102, 241, 0.05), transparent 50%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.auth-page .logo {
    text-align: center;
    margin-bottom: 32px;
}

body.auth-page .logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

body.auth-page .logo h1 span {
    color: var(--primary);
}

body.auth-page .logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

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

body.auth-page .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

body.auth-page .form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

body.auth-page .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

body.auth-page .form-group input::placeholder {
    color: var(--text-muted);
}

body.auth-page .form-group input.error {
    border-color: var(--error);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s ease;
    border-radius: 4px;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

/* Password reveal button styling */
.form-group input[type="password"]::-ms-reveal,
.form-group input[type="password"]::-ms-clear {
    display: none;
}

.form-group input[type="password"]::-webkit-credentials-auto-fill-button,
.form-group input[type="password"]::-webkit-clear-button {
    filter: invert(1);
}

input::-webkit-credentials-auto-fill-button {
    background-color: white !important;
}

/* For browsers that support it */
input[type="password"] {
    color-scheme: dark;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.forgot-link {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary);
}

body.auth-page .btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.auth-page .btn-primary {
    background: var(--primary);
    color: white;
}

body.auth-page .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

body.auth-page .btn-primary:active {
    transform: translateY(0);
}

body.auth-page .btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

body.auth-page .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    margin-top: 16px;
    display: block;
    text-align: center;
    text-decoration: none;
}

body.auth-page .btn-secondary:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 16px;
}

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

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

.auth-footer a:hover {
    color: var(--primary);
}

.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary-light);
}

/* 2FA Styles */
.twofa-container {
    text-align: center;
}

.twofa-icon {
    width: 64px;
    height: 64px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.twofa-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.code-input-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.code-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.code-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.qr-container {
    background: white;
    padding: 16px;
    border-radius: 12px;
    display: inline-block;
    margin: 20px 0;
}

.qr-container img {
    display: block;
}

.secret-key {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-input);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin: 16px 0;
    word-break: break-all;
}

.backup-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 20px 0;
}

.backup-code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-input);
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    color: var(--text-primary);
}

/* Dashboard Styles */
.dashboard-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.welcome-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.welcome-card h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.welcome-card p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px;
    }
    
    .code-input {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }
}
