/* Auth Modal Styles (aligned with main palette) */
:root {
    --auth-bg: #0b0e11;
    --auth-soft: #0f1318;
    --auth-accent: var(--accent, #b4ff3b);
    --auth-accent-soft: rgba(180, 255, 59, 0.18);
    --auth-text: var(--text-main, #f5f7f6);
    --auth-muted: var(--text-muted, #8c909c);
    --auth-border: var(--border-soft, rgba(255, 255, 255, 0.06));
    --auth-radius: 16px;
    --auth-shadow: 0 18px 45px rgba(0, 0, 0, 0.75);
    --auth-transition: 0.22s ease-out;
}

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    display: flex;
    backdrop-filter: blur(8px);
    padding: 24px 12px;
    overflow-x: hidden;
    overflow-y: auto;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.grecaptcha-badge {
    visibility: hidden;
}

body.auth-modal-open .grecaptcha-badge {
    visibility: visible;
}

.auth-modal {
    background:
        radial-gradient(circle at top left, rgba(180, 255, 59, 0.06), transparent 60%),
        var(--auth-bg);
    border-radius: var(--auth-radius);
    width: 100%;
    max-width: 400px;
    padding: 26px 26px 24px;
    position: relative;
    box-shadow: var(--auth-shadow);
    border: 1px solid var(--auth-border);
    box-sizing: border-box;
    max-height: calc(100vh - 48px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(-16px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-modal *,
.auth-modal *::before,
.auth-modal *::after {
    box-sizing: border-box;
}

.auth-modal-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: var(--auth-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s, transform 0.2s;
}

.auth-modal__close:hover {
    color: var(--auth-text);
    transform: scale(1.08);
}

.auth-tabs {
    display: flex;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--auth-border);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--auth-muted);
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--auth-transition), border-bottom-color var(--auth-transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tab.active {
    color: var(--auth-accent);
    border-bottom-color: var(--auth-accent);
}

/* Animations */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.auth-form {
    display: none;
    min-width: 0;
}

.auth-form.active {
    display: block;
    animation: fadeInSlide 0.4s ease forwards;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--auth-muted);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    max-width: 100%;
    padding: 10px 20px;
    background: var(--auth-soft);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    color: var(--auth-text);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s, background var(--auth-transition);
}

.form-group input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 1px var(--auth-accent-soft);
    outline: none;
    background: #0b1018;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--auth-accent), #9be65a);
    color: #050608;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s, box-shadow var(--auth-transition);
    margin-top: 10px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.8);
}

.auth-submit-btn:hover {
    background: var(--auth-accent);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.9);
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.auth-message.error {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    display: block;
    animation: shake 0.4s ease;
}

.auth-message.success {
    background: var(--auth-accent-soft);
    color: var(--auth-accent);
    border: 1px solid var(--auth-accent);
    display: block;
    animation: fadeInSlide 0.4s ease;
}

.auth-form__footer {
    margin-top: 12px;
    text-align: center;
}

.auth-reset-link {
    background: none;
    border: none;
    color: var(--auth-muted);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.auth-reset-link:hover,
.auth-reset-link:focus-visible {
    color: var(--auth-accent);
}

.auth-modal .social-login {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #333;
    text-align: center;
}

.auth-modal .social-login p {
    color: var(--auth-muted);
    font-size: 14px;
    margin-bottom: 15px;
}

.auth-modal .social-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.auth-modal .social-buttons .social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--auth-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-text);
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
}

.auth-modal .social-buttons .social-btn:hover {
    background: #0b1018;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal-overlay {
        padding: 18px 10px;
    }

    .auth-modal {
        width: min(90%, 360px);
        padding: 18px 16px 14px;
        border-radius: 14px;
        max-height: calc(100vh - 36px);
    }

    .auth-modal__close {
        top: 10px;
        right: 10px;
    }

    .auth-tabs {
        margin-bottom: 14px;
    }

    .auth-tab {
        font-size: 13px;
        padding: 8px 0;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input {
        font-size: 13px;
        padding: 10px 14px;
    }

    .auth-submit-btn {
        font-size: 14px;
        padding: 10px;
    }

    .google-divider {
        margin: 16px 0 12px;
    }

    .auth-modal .social-login-widgets {
        gap: 10px;
    }
}

/* Google OAuth Styles */
.auth-modal .google-divider {
    position: relative;
    text-align: center;
    margin: 20px 0 15px;
}

.auth-modal .google-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--auth-border);
}

.auth-modal .google-divider span {
    background: var(--auth-bg);
    color: var(--auth-muted);
    padding: 0 12px;
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.auth-modal .social-login-widgets {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

/* Social Login Buttons */
.auth-modal .social-login-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
}

.auth-modal .social-login-buttons .social-btn {
    width: 52px;
    height: 52px;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.auth-modal .social-login-buttons .social-btn:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.auth-modal .social-login-buttons .social-btn:active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
}

.auth-modal .social-login-buttons .social-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.auth-modal .social-login-buttons .social-btn:hover svg {
    transform: scale(1.1);
}

/* Tooltip for social buttons */
.auth-modal .social-login-buttons .social-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, bottom 0.3s ease;
    z-index: 1000;
}

.auth-modal .social-login-buttons .social-btn:hover::after {
    opacity: 1;
    bottom: -40px;
}

/* Google specific styles */
.auth-modal .google-btn-custom:hover {
    border-color: #4285F4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

/* Future Discord button styles */
.auth-modal .discord-btn-custom {
    background: #5865F2;
    border-color: #5865F2;
}

.auth-modal .discord-btn-custom:hover {
    background: #4752C4;
    border-color: #4752C4;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.auth-modal .discord-btn-custom svg {
    fill: white;
}

/* Future Telegram button styles */
.telegram-btn-custom {
    background: #0088CC;
    border-color: #0088CC;
}

.telegram-btn-custom:hover {
    background: #0077B3;
    border-color: #0077B3;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.telegram-btn-custom svg {
    fill: white;
}

/* Styled Google button container */
.google-styled-button-container {
    position: absolute;
    left: -9999px;
    top: -9999px;
    visibility: hidden;
}

/* Override Google button styles to match our design */
.google-styled-button-container div[id^="gsi_"] button {
    width: 52px !important;
    height: 52px !important;
    border: 2px solid #e0e0e0 !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    min-width: 52px !important;
    min-height: 52px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

.google-styled-button-container div[id^="gsi_"] button:hover {
    background: #f8f9fa !important;
    border-color: #dadce0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
}

.google-styled-button-container div[id^="gsi_"] button:active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(0) !important;
}

/* Hide text in Google button, show only icon */
.google-styled-button-container div[id^="gsi_"] button span[role="text"] {
    display: none !important;
}

/* Show only Google logo */
.google-styled-button-container div[id^="gsi_"] button::before {
    content: '' !important;
}
