/**
 * BCM Auth - Base/Neutral Styles
 *
 * Shared styles for popup, content wall, profile, and toast.
 * Uses CSS custom properties so themes can override colors, fonts, etc.
 * Import this file and then override --bcm-auth-* variables in your theme.
 */

/* ------------------------------------------------------------------ */
/*  CSS Custom Properties (themeable)                                  */
/* ------------------------------------------------------------------ */

:root {
    --bcm-auth-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bcm-auth-primary: #333333;
    --bcm-auth-primary-hover: #1a1a1a;
    --bcm-auth-text: #1d1f21;
    --bcm-auth-text-secondary: #6a6a6a;
    --bcm-auth-bg: #ffffff;
    --bcm-auth-overlay-bg: rgba(0, 0, 0, 0.6);
    --bcm-auth-border: #e0e0e0;
    --bcm-auth-input-bg: #f8f7f7;
    --bcm-auth-error: #dc3545;
    --bcm-auth-success: #1f1f1f;
    --bcm-auth-radius: 12px;
    --bcm-auth-radius-sm: 8px;
    --bcm-auth-radius-pill: 100px;
}

/* ------------------------------------------------------------------ */
/*  Overlay                                                            */
/* ------------------------------------------------------------------ */

.bcm-auth-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bcm-auth-overlay-bg);
    font-family: var(--bcm-auth-font-family);
    animation: bcmAuthFadeIn 0.2s ease;
}

.bcm-auth-popup-open {
    overflow: hidden;
}

@keyframes bcmAuthFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ------------------------------------------------------------------ */
/*  Popup Container                                                    */
/* ------------------------------------------------------------------ */

.bcm-auth-popup {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bcm-auth-bg);
    border-radius: var(--bcm-auth-radius);
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: bcmAuthSlideUp 0.3s ease;
}

@keyframes bcmAuthSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bcm-auth-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--bcm-auth-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}

.bcm-auth-popup-close:hover {
    background: var(--bcm-auth-input-bg);
}

/* ------------------------------------------------------------------ */
/*  Logo (shared popup + wall)                                         */
/* ------------------------------------------------------------------ */

.bcm-auth-popup-logo {
    text-align: center;
    margin-bottom: 20px;
}

.bcm-auth-popup-logo img,
.bcm-auth-wall-logo img {
    max-height: 40px;
    width: auto;
}

.bcm-auth-popup-logo-placeholder,
.bcm-auth-wall-logo {
    width: 40px;
    height: 40px;
    background: var(--bcm-auth-primary);
    border-radius: var(--bcm-auth-radius-sm);
    margin: 0 auto;
}

.bcm-auth-wall-logo {
    margin-bottom: 20px;
}

/* ------------------------------------------------------------------ */
/*  Headings & Text (shared popup + wall)                              */
/* ------------------------------------------------------------------ */

.bcm-auth-popup-heading,
.bcm-auth-wall-heading {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--bcm-auth-text);
    margin: 0 0 8px;
    line-height: 1.3;
}

.bcm-auth-popup-desc,
.bcm-auth-wall-desc {
    text-align: center;
    font-size: 14px;
    color: var(--bcm-auth-text-secondary);
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/*  Social Buttons                                                     */
/* ------------------------------------------------------------------ */

.bcm-auth-social-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.bcm-auth-social-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--bcm-auth-border);
    background: var(--bcm-auth-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, box-shadow 0.15s;
    padding: 0;
}

.bcm-auth-social-btn:hover {
    border-color: var(--bcm-auth-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bcm-auth-social-icon {
    display: block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.bcm-auth-icon-google {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z'/%3E%3Cpath fill='%2334A853' d='M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z'/%3E%3Cpath fill='%23FBBC05' d='M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z'/%3E%3Cpath fill='%23EA4335' d='M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z'/%3E%3C/svg%3E");
}

.bcm-auth-icon-linkedin {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230A66C2' d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E");
}

.bcm-auth-icon-x {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ */
/*  "or" Divider                                                       */
/* ------------------------------------------------------------------ */

.bcm-auth-or-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--bcm-auth-text-secondary);
    font-size: 13px;
    font-family: var(--bcm-auth-font-family);
}

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

/* ------------------------------------------------------------------ */
/*  Email Input (shared popup + wall)                                  */
/* ------------------------------------------------------------------ */

.bcm-auth-input-group {
    position: relative;
    margin-bottom: 24px;
}

.bcm-auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    color: var(--bcm-auth-text-secondary);
    pointer-events: none;
    z-index: 1;
}

.bcm-auth-input-icon + .bcm-auth-email-input {
    padding-left: 42px;
}

.bcm-auth-email-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--bcm-auth-border);
    border-radius: var(--bcm-auth-radius-sm);
    background: var(--bcm-auth-input-bg);
    font-size: 16px;
    font-family: var(--bcm-auth-font-family);
    color: var(--bcm-auth-text);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    min-height: 48px;
}

.bcm-auth-email-input:focus {
    border-color: var(--bcm-auth-primary);
}

.bcm-auth-email-input::placeholder {
    color: var(--bcm-auth-text-secondary);
}

/* ------------------------------------------------------------------ */
/*  Submit Button                                                      */
/* ------------------------------------------------------------------ */

.bcm-auth-submit-btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: var(--bcm-auth-radius-sm);
    background: var(--bcm-auth-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--bcm-auth-font-family);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.bcm-auth-submit-btn:hover {
    background: var(--bcm-auth-primary-hover);
}

.bcm-auth-submit-btn:disabled {
    background: #ECECEC;
    border-color: #ECECEC;
    color: #6A6A6A;
    box-shadow: none;
    cursor: not-allowed;
}

.bcm-auth-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bcmAuthSpin 0.6s linear infinite;
}

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

/* ------------------------------------------------------------------ */
/*  OTP Inputs                                                         */
/* ------------------------------------------------------------------ */

.bcm-auth-otp-inputs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.bcm-auth-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    font-family: var(--bcm-auth-font-family);
    border: 1px solid var(--bcm-auth-border);
    border-radius: var(--bcm-auth-radius-sm);
    background: var(--bcm-auth-input-bg);
    color: var(--bcm-auth-text);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.bcm-auth-otp-digit:focus {
    border-color: var(--bcm-auth-primary);
}

.bcm-auth-otp-status {
    text-align: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.bcm-auth-otp-error {
    color: var(--bcm-auth-error);
}

.bcm-auth-otp-resend {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--bcm-auth-text-secondary);
}

.bcm-auth-resend-btn {
    background: none;
    border: none;
    color: var(--bcm-auth-primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--bcm-auth-font-family);
    text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/*  Interest Chips                                                     */
/* ------------------------------------------------------------------ */

.bcm-auth-interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.bcm-auth-interest-chip {
    cursor: pointer;
}

.bcm-auth-interest-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bcm-auth-interest-label {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--bcm-auth-border);
    border-radius: var(--bcm-auth-radius-pill);
    font-size: 14px;
    color: var(--bcm-auth-text);
    background: var(--bcm-auth-bg);
    transition: all 0.15s;
    user-select: none;
}

.bcm-auth-interest-input:checked + .bcm-auth-interest-label {
    background: var(--bcm-auth-primary);
    color: #fff;
    border-color: var(--bcm-auth-primary);
}

.bcm-auth-interest-label:hover {
    border-color: var(--bcm-auth-primary);
}

.bcm-auth-skip-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: var(--bcm-auth-text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    margin-top: 8px;
    font-family: var(--bcm-auth-font-family);
}

.bcm-auth-skip-btn:hover {
    color: var(--bcm-auth-text);
}

/* ------------------------------------------------------------------ */
/*  Error Message                                                      */
/* ------------------------------------------------------------------ */

.bcm-auth-error-message {
    text-align: center;
    color: var(--bcm-auth-error);
    font-size: 13px;
    margin-top: 12px;
}

/* ------------------------------------------------------------------ */
/*  Profile Button                                                     */
/* ------------------------------------------------------------------ */

.bcm-auth-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.bcm-auth-btn {
    padding: 8px 16px;
    border: 1px solid var(--bcm-auth-border);
    border-radius: var(--bcm-auth-radius-sm);
    background: transparent;
    color: var(--bcm-auth-text);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--bcm-auth-font-family);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.bcm-auth-btn:hover {
    border-color: var(--bcm-auth-primary);
    color: var(--bcm-auth-primary);
}

.bcm-auth-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--bcm-auth-radius-sm);
    transition: background 0.15s;
    font-family: var(--bcm-auth-font-family);
}

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

.bcm-auth-avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bcm-auth-text);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

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

/* Profile Dropdown */
.bcm-auth-profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bcm-auth-bg);
    border: 1px solid var(--bcm-auth-border);
    border-radius: var(--bcm-auth-radius-sm);
    padding: 10px;
    min-width: 120px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.bcm-auth-profile-info {
    padding-bottom: 5px;
    border-bottom: 1px solid var(--bcm-auth-border);
}

.bcm-auth-profile-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--bcm-auth-text);
}

.bcm-auth-profile-email {
    display: block;
    font-size: 13px;
    color: var(--bcm-auth-text-secondary);
    margin-top: 2px;
}

.bcm-auth-logout-btn {
    background: none;
    border: none;
    color: var(--bcm-auth-error);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
    font-family: var(--bcm-auth-font-family);
}

.bcm-auth-logout-btn:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/*  Toast                                                              */
/* ------------------------------------------------------------------ */

.bcm-auth-toast {
    position: fixed;
    max-width: 500px;
    margin: 100px auto 0;
    left: 0;
    right: 0;
    border-radius: var(--bcm-auth-radius);
    z-index: 9999999;
    animation: bcmAuthToastIn 0.3s ease;
}

@keyframes bcmAuthToastIn {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.bcm-auth-toast-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    font-family: var(--bcm-auth-font-family);
    font-size: 15px;
    font-weight: 500;
}

.bcm-auth-toast-success .bcm-auth-toast-inner {
    background: var(--bcm-auth-success);
    color: #fff;
}

.bcm-auth-toast-error .bcm-auth-toast-inner {
    background: var(--bcm-auth-error);
    color: #fff;
}

.bcm-auth-toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}

.bcm-auth-toast-close:hover {
    opacity: 1;
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                         */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    .bcm-auth-popup {
        max-width: calc(100% - 32px);
    }
}

@media (max-width: 480px) {
    .bcm-auth-popup {
        max-width: 100%;
        margin: 16px;
        padding: 32px 20px;
    }

    .bcm-auth-otp-digit {
        width: 42px;
        height: 48px;
        font-size: 20px;
    }

    .bcm-auth-popup-heading,
    .bcm-auth-wall-heading {
        font-size: 20px;
    }
}