/* Auth Modal Styles */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay, rgba(0, 0, 0, 0.45));
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.auth-overlay[aria-hidden="false"] {
    display: flex;
}

.auth-modal {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #dddddd);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: min(480px, 100%);
    max-height: 90vh;
    overflow: auto;
    color: var(--text-main, #000000);
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color-soft, #cccccc);
    background: var(--bg-card);
}

.auth-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.auth-title i {
    font-size: 1rem;
    opacity: 0.85;
}

.auth-close {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color-soft, #cccccc);
    border-radius: 4px;
    background: transparent;
    color: var(--text-main, #000000);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.auth-close:hover {
    background: rgba(25, 118, 210, 0.08);
    border-color: var(--accent, #1976d2);
}

:root.dark-mode .auth-close:hover {
    background: rgba(100, 181, 246, 0.12);
}

.auth-body {
    padding: 18px;
}

.auth-grid {
    display: grid;
    gap: 14px;
}

/* User Info Display - matches result-item style */
.user-info-display {
    padding: 0px 14px;
    border: 1px solid var(--border-color-soft);
    border-radius: 6px;
    margin-bottom: 4px;
}

:root.dark-mode .user-info-display {
    background: rgba(100, 181, 246, 0.04);
    border-color: var(--border-color);
}

.user-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 12px;
}

.user-info-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color-soft);
}

:root.dark-mode .user-info-row:not(:last-child) {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.user-info-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.user-info-value {
    font-weight: 600;
    color: var(--text-main);
}

/* Status badges - matching filter-link style */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid;
}

.status-badge.status-active {
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
    border-color: rgba(76, 175, 80, 0.3);
}

:root.dark-mode .status-badge.status-active {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    border-color: rgba(76, 175, 80, 0.35);
}

.status-badge.status-superuser {
    background: rgba(255, 193, 7, 0.15);
    color: #f57c00;
    border-color: rgba(255, 193, 7, 0.4);
}

:root.dark-mode .status-badge.status-superuser {
    background: rgba(255, 193, 7, 0.18);
    color: #ffb300;
    border-color: rgba(255, 193, 7, 0.45);
}

.status-badge.status-points {
    background: rgba(25, 118, 210, 0.12);
    color: var(--accent, #1976d2);
    border-color: rgba(25, 118, 210, 0.3);
    font-variant-numeric: tabular-nums;
}

:root.dark-mode .status-badge.status-points {
    background: rgba(100, 181, 246, 0.15);
    color: #90caf9;
    border-color: rgba(100, 181, 246, 0.35);
}

/* Form fields */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main, #000000);
}

.auth-input {
    padding: 9px 12px;
    border: 1px solid var(--border-color-soft, #cccccc);
    border-radius: 4px;
    background: var(--bg-body, #ffffff);
    color: var(--text-main, #000000);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
    border-color: var(--accent, #1976d2);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

:root.dark-mode .auth-input:focus {
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.15);
}

.auth-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-sidebar, #f5f5f5);
}

:root.dark-mode .auth-input:disabled {
    background: rgba(255, 255, 255, 0.05);
}

/* Error message - smooth appearance without reserved space */
.auth-error {
    padding: 0;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-error, #b30000);
    font-size: 0.88rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.2s ease;
    margin: 0;
}

.auth-error:not(:empty) {
    padding: 10px 12px;
    background: rgba(211, 47, 47, 0.1);
    border-color: rgba(211, 47, 47, 0.3);
    max-height: 200px;
    opacity: 1;
    margin: 0;
}

:root.dark-mode .auth-error:not(:empty) {
    background: rgba(211, 47, 47, 0.15);
    border-color: rgba(211, 47, 47, 0.4);
}

/* Action buttons - matching page button style */
.auth-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

.auth-btn {
    padding: 8px 18px;
    border: 1px solid var(--border-color-soft, #cccccc);
    border-radius: 4px;
    background: var(--bg-btn, transparent);
    color: var(--text-main, #000000);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.auth-btn:hover {
    background: rgba(25, 118, 210, 0.08);
    border-color: var(--accent, #1976d2);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-btn.primary {
    background: var(--accent, #1976d2);
    border-color: var(--accent, #1976d2);
    color: #ffffff;
}

.auth-btn.primary:hover {
    background: #1565c0;
    border-color: #1565c0;
}

:root.dark-mode .auth-btn.primary {
    background: #006fc8;
    border-color: #006fc8;
}

:root.dark-mode .auth-btn.primary:hover {
    background: #005a9e;
    border-color: #005a9e;
}

.auth-btn.danger {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #ffffff;
}

.auth-btn.danger:hover {
    background: #c62828;
    border-color: #c62828;
}

/* Toggle link */
.auth-toggle {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color-soft);
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted, #777777);
}

.auth-toggle-link {
    color: var(--accent, #1976d2);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.15s ease;
}

.auth-toggle-link:hover {
    text-decoration: underline;
    color: #1565c0;
}

:root.dark-mode .auth-toggle-link {
    color: #90caf9;
}

:root.dark-mode .auth-toggle-link:hover {
    color: #64b5f6;
}

/* Register mode adjustments */
.auth-field.optional {
    display: none;
}

.auth-mode-register .auth-field.optional {
    display: flex;
}

/* Password field with toggle visibility */
.auth-field-password {
    position: relative;
}

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

.password-toggle-btn:hover {
    background: rgba(25, 118, 210, 0.08);
    color: var(--text-main);
}

:root.dark-mode .password-toggle-btn:hover {
    background: rgba(100, 181, 246, 0.12);
}

/* Change password button */
.auth-btn.secondary {
    background: transparent;
    border-color: var(--border-color-soft);
    color: var(--text-main);
}

.auth-btn.secondary:hover {
    background: rgba(25, 118, 210, 0.08);
    border-color: var(--accent);
}

:root.dark-mode .auth-btn.secondary:hover {
    background: rgba(100, 181, 246, 0.12);
}

/* User info in logged-in state */
.user-info-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-info-field .auth-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
}

.user-info-field .auth-input {
    background: var(--bg-body);
    opacity: 0.85;
}

.user-info-field .auth-input:disabled {
    cursor: default;
}

/* Dark mode adjustments */
:root.dark-mode .auth-modal {
    background: var(--bg-card, #1e1e1e);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

:root.dark-mode .auth-input {
    background: var(--bg-body, #121212);
}

:root.dark-mode .auth-btn:hover {
    background: rgba(100, 181, 246, 0.12);
    border-color: #90caf9;
}
