/**
 * Authentication Styles
 * Pink-themed styles matching newsum.io design
 */

:root {
    --auth-primary: #e91e63;
    --auth-primary-dark: #c2185b;
    --auth-primary-light: #f8bbd9;
    --auth-background: #fff5f8;
    --auth-card-bg: #ffffff;
    --auth-text: #1e293b;
    --auth-text-light: #64748b;
    --auth-error: #dc2626;
    --auth-error-bg: #fef2f2;
    --auth-success: #16a34a;
    --auth-success-bg: #f0fdf4;
    --auth-border: #fce4ec;
    --auth-input-border: #e2e8f0;
    --auth-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --auth-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--auth-background) 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.auth-card {
    background: var(--auth-card-bg);
    border-radius: 16px;
    box-shadow: var(--auth-shadow-lg);
    padding: 40px;
    border: 1px solid var(--auth-border);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 60px;
    height: 60px;
    background: var(--auth-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0 0 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--auth-text-light);
    margin: 0;
}

/* Form styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-text);
}

.form-input {
    padding: 12px 16px;
    border: 2px solid var(--auth-input-border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-primary-light);
}

.form-input::placeholder {
    color: #94a3b8;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

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

.btn-primary:disabled {
    background: var(--auth-primary-light);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: var(--auth-text);
    border: 2px solid var(--auth-input-border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-google {
    background: white;
    color: var(--auth-text);
    border: 2px solid var(--auth-input-border);
}

.btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

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

.auth-divider span {
    font-size: 12px;
    color: var(--auth-text-light);
    text-transform: uppercase;
    font-weight: 500;
}

/* Links */
.auth-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-border);
}

.auth-footer p {
    margin: 0;
    font-size: 14px;
    color: var(--auth-text-light);
}

/* Messages */
.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.auth-message.show {
    display: block;
}

.auth-message.error {
    background: var(--auth-error-bg);
    color: var(--auth-error);
    border: 1px solid #fecaca;
}

.auth-message.success {
    background: var(--auth-success-bg);
    color: var(--auth-success);
    border: 1px solid #bbf7d0;
}

.auth-message.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Forgot password link */
.forgot-password {
    text-align: right;
    margin-top: -12px;
}

.forgot-password a {
    font-size: 13px;
}

/* Password requirements */
.password-requirements {
    font-size: 12px;
    color: var(--auth-text-light);
    margin-top: 4px;
}

/* Tabs for login/signup */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--auth-border);
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--auth-text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

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

.auth-tab.active {
    color: var(--auth-primary);
    border-bottom-color: var(--auth-primary);
}

/* Form sections */
.auth-section {
    display: none;
}

.auth-section.active {
    display: block;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--auth-text-light);
    text-decoration: none;
    margin-bottom: 16px;
}

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

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
    }

    .auth-container {
        padding: 16px;
    }
}

/* User menu component */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-menu-trigger:hover {
    background: rgba(233, 30, 99, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--auth-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    color: var(--auth-text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--auth-shadow-lg);
    border: 1px solid var(--auth-border);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-item {
    display: block;
    padding: 12px 16px;
    color: var(--auth-text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.user-menu-item:hover {
    background: var(--auth-background);
}

.user-menu-item.logout {
    color: var(--auth-error);
    border-top: 1px solid var(--auth-border);
}

.user-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--auth-border);
}

.user-menu-email {
    font-size: 12px;
    color: var(--auth-text-light);
    margin: 0;
}

.user-menu-groups {
    font-size: 11px;
    color: var(--auth-primary);
    margin: 4px 0 0;
}
