:root {
    /* Structural colors - dark palette (the site's original, default look) */
    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --bg-hover: #334155;
    --border: #334155;
    --border-subtle: #1e293b;
    --border-muted: #475569;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #cbd5e1;
    --text-muted: #64748b;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-modal: 0 10px 30px rgba(0, 0, 0, 0.4);
    --overlay-backdrop: rgba(0, 0, 0, 0.6);

    /* Accent colors - same in both themes except where noted below */
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --link-blue: #60a5fa;
    --link-sky: #38bdf8;
    --accent-green: #4ade80;
    --accent-red: #f87171;
    --accent-amber: #fbbf24;
    --accent-violet: #a78bfa;

    --error-bg: #7f1d1d;
    --error-text: #fecaca;
    --success-bg: #14532d;
    --success-text: #bbf7d0;
}

/* Light palette override, applied when the logged-in user's saved theme is 'Light' */
body.theme-light {
    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-hover: #e2e8f0;
    --border: #cbd5e1;
    --border-subtle: #e2e8f0;
    --border-muted: #94a3b8;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #334155;
    --text-muted: #94a3b8;
    --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.1);
    --shadow-modal: 0 10px 30px rgba(15, 23, 42, 0.15);
    --overlay-backdrop: rgba(15, 23, 42, 0.5);

    --link-blue: #2563eb;
    --link-sky: #0284c7;
    --accent-green: #16a34a;
    --accent-red: #dc2626;
    --accent-amber: #b45309;
    --accent-violet: #7c3aed;

    --error-bg: #fee2e2;
    --error-text: #b91c1c;
    --success-bg: #dcfce7;
    --success-text: #15803d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-card);
}

.auth-card h1 {
    margin: 0 0 4px;
    font-size: 22px;
}

.auth-card p.subtitle {
    margin: 0 0 28px;
    color: var(--text-secondary);
    font-size: 14px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
}

.field input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

button.primary {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 6px;
    background: var(--accent-blue);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

button.primary:hover {
    background: var(--accent-blue-hover);
}

button.primary:disabled {
    background: var(--border-muted);
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.form-actions button.primary {
    flex: 1;
}

a.button.secondary {
    flex: 1;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

a.button.secondary:hover {
    background: var(--bg-hover);
}

.error-message {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 18px;
    display: none;
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 8px 4px;
    margin-right: 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.tab:hover {
    color: var(--text-tertiary);
}

.tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-blue);
}

.success-message {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 18px;
    display: none;
}

.action-link {
    font-size: 12px;
    text-decoration: none;
}

.action-link:hover {
    text-decoration: underline;
}

.actions-menu {
    position: relative;
    display: inline-block;
}

.actions-menu-btn {
    font-size: 12px;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
}

.actions-menu-btn:hover {
    border-color: var(--link-blue);
}

.actions-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 170px;
    box-shadow: var(--shadow-card);
    z-index: 20;
    overflow: hidden;
}

.actions-menu-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: none;
}

.actions-menu-dropdown a:hover {
    background: var(--bg-hover);
}

.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: var(--overlay-backdrop);
    z-index: 100;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-modal);
}

.modal-box h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.feedback-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.feedback-type-btn {
    flex: 1;
    padding: 9px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
}

.feedback-type-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    font-weight: 600;
}

#feedback-message {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

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

.switch-link a {
    color: var(--link-blue);
    text-decoration: none;
}

.switch-link a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .auth-card {
        padding: 28px 20px;
    }
}
