/* BoldBoy Auth Modal Styles - Premium Dark Theme with High Specificity */
:root {
    --bb-bg-primary: #121212;
    --bb-bg-secondary: #1e1e1e;
    --bb-bg-input: #f3f4f6;
    /* user wants black text, so white background is best contrast, or light gray */
    --bb-text-primary: #ffffff;
    --bb-text-secondary: #a0a0a0;
    --bb-text-input: #000000;
    /* Explicitly black as requested */
    --bb-accent: #ffffff;
    --bb-border: #333333;
    --bb-error: #ff5252;
    --bb-success: #4caf50;
    --bb-radius: 12px;
}

#bb-auth-modal.bb-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999;
    /* Max z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: var(--bb-text-primary);
    line-height: normal;
    /* Reset line-height */
}

#bb-auth-modal .bb-auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: bbFadeInOverlay 0.3s ease-out;
}

@keyframes bbFadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#bb-auth-modal .bb-auth-container {
    position: relative;
    background: var(--bb-bg-primary);
    width: 100%;
    max-width: 420px;
    border-radius: var(--bb-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    /* This might hide close button if it's positioned outside, but it's inside */
    animation: bbSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 20px;
    border: 1px solid var(--bb-border);
    color: var(--bb-text-primary);
    box-sizing: border-box;
}

@keyframes bbSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button - High specificity and z-index */
#bb-auth-modal .bb-auth-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #ffffff;
    z-index: 100;
    /* Ensure it's above everything in the container */
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
}

#bb-auth-modal .bb-auth-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* Tabs */
#bb-auth-modal .bb-auth-tabs {
    display: flex;
    background: var(--bb-bg-secondary);
    padding: 5px 5px 0;
}

#bb-auth-modal .bb-auth-tab {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--bb-text-secondary);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

#bb-auth-modal .bb-auth-tab:hover {
    color: var(--bb-text-primary);
}

#bb-auth-modal .bb-auth-tab.active {
    color: var(--bb-accent);
    border-bottom-color: var(--bb-accent);
}

/* Content */
#bb-auth-modal .bb-auth-content {
    padding: 30px;
}

#bb-auth-modal .bb-auth-panel {
    display: none;
    animation: bbFadeIn 0.3s ease-out;
}

@keyframes bbFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#bb-auth-modal .bb-auth-panel.active {
    display: block;
}

/* Forms */
#bb-auth-modal .bb-form-group {
    margin-bottom: 20px;
}

#bb-auth-modal .bb-form-row {
    display: flex;
    gap: 15px;
}

#bb-auth-modal .bb-form-row .bb-form-group {
    flex: 1;
}

#bb-auth-modal .bb-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: var(--bb-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#bb-auth-modal .bb-form-group input[type="text"],
#bb-auth-modal .bb-form-group input[type="email"],
#bb-auth-modal .bb-form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    background: var(--bb-bg-input);
    border: 1px solid var(--bb-border);
    border-radius: 6px;
    font-size: 15px;
    color: var(--bb-text-input);
    /* Black text */
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
    height: auto;
    margin: 0;
}

#bb-auth-modal .bb-form-group input:focus {
    border-color: var(--bb-accent);
    background: #333;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Checkboxes and Links */
#bb-auth-modal .bb-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 13px;
    color: var(--bb-text-secondary);
}

#bb-auth-modal .bb-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

#bb-auth-modal .bb-checkbox input {
    margin-right: 8px;
    accent-color: var(--bb-accent);
    /* Browser native accent */
    width: 16px;
    height: 16px;
    border: 1px solid var(--bb-border);
}

#bb-auth-modal .bb-forgot-pass {
    color: var(--bb-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

#bb-auth-modal .bb-forgot-pass:hover {
    color: var(--bb-text-primary);
    text-decoration: underline;
}

/* Buttons */
#bb-auth-modal .bb-btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--bb-accent);
    color: #000000;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0;
}

#bb-auth-modal .bb-btn-primary:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#bb-auth-modal .bb-btn-primary:active {
    transform: translateY(0);
}

.bb-btn-primary:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.bb-form-message {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    display: none;
    /* Hidden by default */
}

.bb-form-message:not(:empty) {
    display: block;
}

.bb-form-message.error {
    background: rgba(255, 82, 82, 0.1);
    color: var(--bb-error);
    border: 1px solid rgba(255, 82, 82, 0.2);
}

.bb-form-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--bb-success);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

/* Marketing Checkbox */
.bb-marketing-check {
    border-top: 1px solid var(--bb-border);
    padding-top: 15px;
    margin-top: 5px;
}

/* Logged In Dashboard */
.bb-logged-in {
    text-align: center;
}

.bb-auth-dashboard {
    padding: 40px 30px;
}

.bb-user-info {
    margin-bottom: 30px;
}

.bb-avatar img {
    border-radius: 50%;
    border: 3px solid var(--bb-accent);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.bb-user-info h3 {
    margin: 10px 0 5px 0;
    font-size: 22px;
    font-weight: 700;
}

.bb-user-email {
    margin: 0;
    color: var(--bb-text-secondary);
    font-size: 14px;
}

.bb-dashboard-links {
    display: grid;
    gap: 12px;
}

.bb-dash-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--bb-bg-input);
    color: var(--bb-text-input);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.bb-dash-link span {
    margin-right: 10px;
    font-size: 18px;
}

.bb-dash-link:hover {
    background: #333;
    border-color: #555;
    color: var(--bb-text-primary);
}

.bb-dash-link.bb-logout {
    margin-top: 10px;
    color: var(--bb-error);
    background: rgba(255, 82, 82, 0.05);
}

.bb-dash-link.bb-logout:hover {
    background: rgba(255, 82, 82, 0.15);
    border-color: rgba(255, 82, 82, 0.3);
}


/* Back Button */
#bb-auth-modal .bb-back-to-login {
    background: none;
    border: none;
    color: var(--bb-text-secondary);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    font-weight: 500;
    margin-bottom: 20px;
}

#bb-auth-modal .bb-back-to-login:hover {
    color: var(--bb-text-primary);
}


/* Mobile Responsive */
@media (max-width: 480px) {
    .bb-auth-container {
        width: 90%;
        margin: 0 auto;
    }

    .bb-form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Cloudflare Turnstile Widget */
#bb-auth-modal .cf-turnstile {
    margin-top: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

#bb-auth-modal .cf-turnstile iframe {
    max-width: 100%;
    border-radius: 4px;
}