/**
 * WOCOO News — Auth Styles
 * Login, Signup pages + Header user dropdown
 *
 * @package WOCOO_News
 * @since 2.1.0
 */


/* ============================================================
   AUTH PAGE LAYOUT
   ============================================================ */

.auth-page {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6f8;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo a {
    text-decoration: none;
}

.auth-logo img {
    height: 44px;
    width: auto;
}

.auth-logo .logo-text {
    font-size: 2.2rem;
    font-weight: 700;
}


/* ============================================================
   AUTH CARD
   ============================================================ */

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.auth-card-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #E91E63, #FF9800, #4CAF50, #2196F3, #1A237E);
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e2028;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    text-align: center;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}


/* ============================================================
   AUTH MESSAGES
   ============================================================ */

.auth-message {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.auth-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

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


/* ============================================================
   GOOGLE SIGN-IN
   ============================================================ */

.auth-google {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* Override Google button width */
.auth-google iframe {
    margin: 0 auto;
}


/* ============================================================
   DIVIDER
   ============================================================ */

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    font-size: 0.85rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ============================================================
   FORM STYLES
   ============================================================ */

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    color: #1e2028;
}

.auth-form input:focus {
    outline: none;
    border-color: #E91E63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.auth-form input::placeholder {
    color: #9ca3af;
}

/* Forgot password link */
.forgot-link {
    font-size: 0.8rem;
    color: #E91E63;
    text-decoration: none;
    font-weight: 500;
}

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

/* Password wrapper with toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
    display: flex;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #6b7280;
}

/* Password strength */
.password-strength {
    height: 3px;
    border-radius: 3px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
    background: #e5e7eb;
}

.password-strength.weak { background: #ef4444; width: 33%; }
.password-strength.medium { background: #f59e0b; width: 66%; }
.password-strength.strong { background: #22c55e; width: 100%; }

/* Checkbox */
.form-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 0.15rem;
    accent-color: #E91E63;
}

.form-checkbox span {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

.form-checkbox a {
    color: #E91E63;
    text-decoration: none;
}

.form-checkbox a:hover {
    text-decoration: underline;
}


/* ============================================================
   SUBMIT BUTTON
   ============================================================ */

.auth-submit-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: #E91E63;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-submit-btn:hover {
    background: #C2185B;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-submit-btn .btn-spinner svg {
    animation: none; /* SVG has its own animation */
}

.auth-link-btn {
    width: 100%;
    padding: 0.65rem;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.auth-link-btn:hover {
    color: #E91E63;
}


/* ============================================================
   AUTH FOOTER / LINKS
   ============================================================ */

.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: #6b7280;
}

.auth-footer a {
    color: #E91E63;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Journalist CTA */
.auth-journalist-cta {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.auth-journalist-cta p {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.auth-journalist-cta a {
    font-size: 0.85rem;
    color: #E91E63;
    text-decoration: none;
    font-weight: 600;
}

.auth-journalist-cta a:hover {
    text-decoration: underline;
}


/* ============================================================
   HEADER: LOGIN BUTTON
   ============================================================ */

.login-btn {
    padding: 0.55rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    transition: all 0.2s ease;
    background: transparent;
}

.login-btn:hover {
    border-color: #E91E63;
    color: #E91E63;
}


/* ============================================================
   HEADER: USER MENU (logged in)
   ============================================================ */

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    padding: 0.3rem 0.85rem 0.3rem 0.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    color: #374151;
}

.user-menu-trigger:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chevron {
    transition: transform 0.2s ease;
}

.user-menu.open .user-chevron {
    transform: rotate(180deg);
}


/* ============================================================
   USER DROPDOWN
   ============================================================ */

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
    overflow: hidden;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e2028;
}

.dropdown-email {
    font-size: 0.8rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.user-dropdown-links {
    padding: 0.5rem 0;
}

.user-dropdown-links a {
    display: block;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s ease;
}

.user-dropdown-links a:hover {
    background: #f9fafb;
    color: #E91E63;
}

.user-dropdown-links .wocoo-logout-btn {
    border-top: 1px solid #f3f4f6;
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    color: #ef4444;
}

.user-dropdown-links .wocoo-logout-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .auth-page {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-title {
        font-size: 1.4rem;
    }

    .user-name {
        display: none;
    }

    .user-menu-trigger {
        padding: 0.2rem;
        border: none;
    }

    .user-chevron {
        display: none;
    }

    .user-dropdown {
        right: -1rem;
        width: calc(100vw - 2rem);
        max-width: 320px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
    }
}