.auth-modal-overlay *, .auth-modal-overlay *::before, .auth-modal-overlay *::after {
    box-sizing: border-box;
}
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(102, 126, 234, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.auth-modal-overlay.show { opacity: 1; }

.auth-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    padding: 36px 40px 32px;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    position: relative;
    transform: translateY(24px);
    transition: transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.auth-modal-overlay.show .auth-modal { transform: translateY(0); }

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.auth-modal-close:hover { color: #333; }

.auth-modal-logo {
    display: block;
    max-width: 200px;
    height: auto;
    margin: 0 auto 20px;
}

.auth-modal-tabs {
    display: flex;
    border-bottom: 2px solid #e4e6eb;
    margin-bottom: 24px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active { color: #1877f2; border-bottom-color: #1877f2; }

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-encourage {
    background: linear-gradient(135deg, #667eea22, #764ba222);
    border-left: 3px solid #764ba2;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}
.auth-encourage strong { color: #764ba2; }

.auth-social-btn {
    width: 100%;
    padding: 11px 20px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.auth-social-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.auth-social-btn.google { background: white; color: #333; border: 1px solid #ddd; }
.auth-social-btn.google:hover { background: #f8f9fa; }
.auth-social-btn.reddit { background: #FF4500; color: white; }
.auth-social-btn.reddit:hover { background: #d93d00; }
.auth-social-btn.guest { background: #6c757d; color: white; margin-top: 4px; }
.auth-social-btn.guest:hover { background: #545b62; }

.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: #999;
    font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e4e6eb;
}
.auth-divider span { padding: 0 10px; }

.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 13px; font-weight: 500; color: #444; margin-bottom: 5px; }
.auth-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field input:focus { border-color: #1877f2; box-shadow: 0 0 0 3px rgba(24,119,242,0.1); }

.auth-submit {
    width: 100%;
    padding: 11px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s, transform 0.15s;
}
.auth-submit:hover { background: #145db2; transform: translateY(-1px); }

.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: #666; }
.auth-switch a { color: #1877f2; text-decoration: none; font-weight: 500; cursor: pointer; }
.auth-switch a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .auth-modal { padding: 28px 20px 24px; }
}
