/* Global Variables */
:root {
    --primary: #0056b3; 
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #777777;
    --border-color: #cccccc;
    --btn-hover: #e2e6ea;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --border-color: #444444;
    --btn-hover: #333333;
}

/* Theme Color Overrides */
[data-color="red"] { --primary: #dc3545; }
[data-color="green"] { --primary: #198754; }
[data-color="purple"] { --primary: #6f42c1; }
[data-color="orange"] { --primary: #fd7e14; }
[data-color="teal"] { --primary: #20c997; }

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); display: flex; flex-direction: column; align-items: center; min-height: 100vh; transition: background-color 0.3s; }

/* --- Modern Theme Controls --- */
.theme-controls { width: 100%; padding: 15px 25px; display: flex; justify-content: flex-end; gap: 10px; align-items: center; }

/* Icon Buttons */
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.icon-btn:hover { background-color: var(--btn-hover); }
.icon-btn svg { width: 22px; height: 22px; }

/* Sun/Moon Icon Swapping Logic */
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Dropdown Container & Menu */
.color-picker-container { position: relative; }
.color-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}
/* This class is toggled via JavaScript to show the menu */
.color-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.color-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.2s; }
.color-btn:hover { transform: scale(1.15); }
.color-btn.active { border-color: var(--text-main); }

/* --- Responsive Login Card --- */
.login-container { display: flex; justify-content: center; align-items: center; flex: 1; width: 100%; padding: 20px; }
.login-card { background-color: var(--card-bg); padding: 40px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); width: 100%; max-width: 450px; transition: background-color 0.3s; }
.login-card h2 { text-align: center; margin-bottom: 5px; font-weight: 600; }
.subtitle { color: var(--text-muted); text-align: center; margin-bottom: 25px; font-size: 14.5px; }

/* Forms & Buttons */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.form-group input { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); background-color: var(--bg-color); color: var(--text-main); border-radius: 6px; font-size: 15px; transition: border-color 0.3s; }
.form-group input:focus { border-color: var(--primary); outline: none; }
.btn-primary { width: 100%; padding: 12px; background-color: var(--primary); color: white; border: none; border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity 0.3s, transform 0.1s; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

/* Links & Errors */
.forgot-password { display: block; text-align: center; margin-top: 20px; color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 500; }
.forgot-password:hover { text-decoration: underline; }
.error-alert { background-color: rgba(220, 53, 69, 0.1); color: #dc3545; padding: 12px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; text-align: center; border: 1px solid rgba(220, 53, 69, 0.2); }

@media (max-width: 480px) { .login-card { padding: 30px 20px; } }