/*
 * ═══════════════════════════════════════════════════════════════
 * GPTMAX — LOGIN PAGE THEME OVERRIDE
 * gptmax-login-theme.css
 * ═══════════════════════════════════════════════════════════════
 *
 * Propósito:
 *   Sobrescrever o estilo padrão do Tabler (tabler.css) e do tema
 *   base (color_css.css) APENAS nas páginas de login/auth, alinhando
 *   o visual ao da landing page GPTMax.
 *
 * Como usar:
 *   Inclua este arquivo APÓS tabler.css e color_css.css no template
 *   base de autenticação (base.auth.html):
 *
 *   <link rel="stylesheet" href="tabler.css">
 *   <link rel="stylesheet" href="color_css.css">
 *   <link rel="stylesheet" href="gptmax-login-theme.css">   ← este
 *
 * Restrições:
 *   • Não altera nenhum arquivo .html do template
 *   • Não quebra outros estilos do sistema (color_css.css)
 *   • Usa apenas seletores presentes nas classes já aplicadas
 *     pelo login.html e login_form.html
 *
 * Design system adotado (idêntico à landing page):
 *   Fontes  → Fredoka One (títulos) + Nunito (corpo)
 *   Cores   → paleta Discord-dark do site principal
 *   Card    → bg-secondary #2B2D31, border sutil, border-radius 20px
 *   Botão   → blurple #5865F2 (substitui o teal #009688 do color_css)
 *   Inputs  → bg #404249, sem borda visível, foco em blurple
 *   Fundo   → #313338 com grid animado + orbes de luz (idêntico ao hero)
 * ═══════════════════════════════════════════════════════════════
 */

/* ── Importação de fontes (mesmas da landing page) ───────────── */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800&display=swap');

/* ── Variáveis do design system (espelha o :root da landing) ── */
:root {
    --gm-blurple: #5865F2;
    --gm-blurple-dark: #4752C4;
    --gm-green: #57F287;
    --gm-yellow: #FEE75C;
    --gm-fuchsia: #EB459E;
    --gm-red: #ED4245;

    --gm-bg-primary: #313338;
    --gm-bg-secondary: #2B2D31;
    --gm-bg-tertiary: #1E1F22;
    --gm-bg-accent: #404249;

    --gm-text-normal: #DBDEE1;
    --gm-text-muted: #80848E;
    --gm-header-primary: #F2F3F5;
    --gm-header-secondary: #B5BAC1;

    --gm-border: rgba(255, 255, 255, 0.07);
    --gm-radius-card: 20px;
}

/* ══════════════════════════════════════════════════════════════
   1. FUNDO DA PÁGINA (auth-body / body na área de auth)
   Alvo: .auth-body e o <body> quando herdado pelo base.auth.html
   ══════════════════════════════════════════════════════════════ */

/*
 * Sobrescreve o background simples do color_css.css (.auth-body).
 * Adiciona o grid animado + orbes exatamente como no hero da landing.
 */
.auth-body,
.auth-body body {
    background-color: var(--gm-bg-primary) !important;
    font-family: 'Nunito', sans-serif !important;
    color: var(--gm-text-normal) !important;
    /* Garante que o fundo cobre a tela toda */
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Grid pontilhado de fundo (mesmo padrão do hero) */
.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(88, 101, 242, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 101, 242, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Orbe blurple — canto superior esquerdo */
.auth-body::after {
    content: '';
    position: fixed;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(88, 101, 242, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    animation: gmOrbFloat 8s ease-in-out infinite alternate;
}

/* Orbe fuchsia — canto inferior direito (via pseudo do page-center) */
.auth-body .page-center::after {
    content: '';
    position: fixed;
    bottom: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(235, 69, 158, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    animation: gmOrbFloat 10s ease-in-out infinite alternate-reverse;
}

@keyframes gmOrbFloat {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(30px, 20px) scale(1.06);
    }
}

/* ══════════════════════════════════════════════════════════════
   2. LAYOUT DE CENTRALIZAÇÃO
   Alvo: .page-center (tabler) + .row.g-0.flex-fill (login.html)
   ══════════════════════════════════════════════════════════════ */

/*
 * login.html usa col-12 col-lg-6 col-xl-4 para o formulário e
 * col-12 col-lg-6 col-xl-8 para a imagem lateral (d-none d-lg-block).
 * Como o usuário quer o form centralizado SEM imagem lateral,
 * escondemos a coluna da imagem e centralizamos o form na tela.
 */

/* Esconde a coluna de imagem lateral sem tocar no HTML */
.auth-body .row.g-0.flex-fill>.col-12.col-lg-6.col-xl-8,
.auth-body .row.g-0.flex-fill>[class*="col-xl-8"] {
    display: none !important;
}

/* Faz a coluna do formulário ocupar toda a largura e centralizar */
.auth-body .row.g-0.flex-fill>.col-12.col-lg-6.col-xl-4,
.auth-body .row.g-0.flex-fill>[class*="col-xl-4"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
}

/* Garante que o row também centraliza verticalmente */
.auth-body .row.g-0.flex-fill {
    min-height: 100vh;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* container-tight: limita a largura do card do form */
.auth-body .container.container-tight {
    max-width: 460px !important;
    width: 100%;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

/* ══════════════════════════════════════════════════════════════
   3. CARD DO FORMULÁRIO
   Alvo: estrutura de container-tight (não há .card explícito no
   login_form.html, o form fica solto — então envolve-se via o
   container-tight com aparência de card)
   ══════════════════════════════════════════════════════════════ */

.auth-body .container.container-tight {
    background: var(--gm-bg-secondary);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius-card);
    padding: 40px 36px !important;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    /* Linha de acento colorida no topo (mesmo padrão do gm-popup) */
    position: relative;
}

.auth-body .container.container-tight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 36px;
    right: 36px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--gm-blurple), var(--gm-fuchsia), var(--gm-green));
    opacity: 0.85;
}

/* ══════════════════════════════════════════════════════════════
   4. LOGO E TÍTULO
   Alvo: .text-center.mb-2 (logo) + h2.h3 (título de boas-vindas)
   ══════════════════════════════════════════════════════════════ */

/* Logo: adiciona espaço inferior extra */
.auth-body .text-center.mb-2 {
    margin-bottom: 16px !important;
}

/* Título principal → fonte Fredoka One, cor clara */
.auth-body h2.h3,
.auth-body .h3 {
    font-family: 'Fredoka One', cursive !important;
    font-size: 26px !important;
    font-weight: 400 !important;
    /* Fredoka One é display, não precisa de bold extra */
    color: var(--gm-header-primary) !important;
    letter-spacing: 0.01em;
    margin-bottom: 24px !important;
}

/* ══════════════════════════════════════════════════════════════
   5. ABAS MEMBRO / CONVIDADO (.login-selector)
   Alvo: ul.nav.nav-pills.login-selector
   ══════════════════════════════════════════════════════════════ */

/*
 * Sobrescreve o color_css.css (.login-selector .nav-link: background #232428)
 * para o novo visual com pill estilo landing.
 */
.auth-body .login-selector {
    background: var(--gm-bg-tertiary);
    border-radius: 100px;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--gm-border);
}

.auth-body .login-selector .nav-item {
    flex: 1;
}

.auth-body .login-selector .nav-link {
    background: transparent !important;
    color: var(--gm-text-muted) !important;
    border-radius: 100px !important;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 16px;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
    border: none;
}

.auth-body .login-selector .nav-link:hover {
    color: var(--gm-header-primary) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Sobrescreve o color_css.css (.login-selector .nav-link.active: background #009688) */
.auth-body .login-selector .nav-link.active {
    color: #fff !important;
    background: var(--gm-blurple) !important;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4) !important;
}

/* ══════════════════════════════════════════════════════════════
   6. LABELS DOS CAMPOS
   Alvo: label.form-label + small.form-label-description
   ══════════════════════════════════════════════════════════════ */

.auth-body .form-label {
    color: var(--gm-header-secondary) !important;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

/* Link "Esqueci a senha" ao lado do label */
.auth-body .form-label-description,
.auth-body .form-label-description a {
    color: var(--gm-text-muted) !important;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.15s;
}

.auth-body .form-label-description a:hover {
    color: var(--gm-blurple) !important;
}

/* ══════════════════════════════════════════════════════════════
   7. INPUTS / FORM CONTROLS
   Alvo: input.form-control, select.form-control, textarea.form-control
   ══════════════════════════════════════════════════════════════ */

/*
 * color_css.css já define background: var(--input-bg) = #464952.
 * Aqui refinamos o visual para combinar com o card mais escuro.
 */
.auth-body .form-control,
.auth-body .form-select {
    background-color: var(--gm-bg-accent) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 10px !important;
    color: var(--gm-text-normal) !important;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-body .form-control::placeholder {
    color: var(--gm-text-muted) !important;
    opacity: 1;
}

.auth-body .form-control:focus,
.auth-body .form-select:focus {
    background-color: var(--gm-bg-accent) !important;
    border-color: rgba(88, 101, 242, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15) !important;
    color: var(--gm-header-primary) !important;
    outline: none !important;
}

/* Autofill do browser (cor de fundo diferente) */
.auth-body .form-control:-webkit-autofill,
.auth-body .form-control:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px var(--gm-bg-accent) inset !important;
    -webkit-text-fill-color: var(--gm-text-normal) !important;
    caret-color: var(--gm-text-normal);
}

/* ── Input group (senha com ícone olho) ─────────────────────── */
.auth-body .input-group-flat {
    border-radius: 10px;
    overflow: hidden;
}

.auth-body .input-group-flat .form-control {
    border-right: none !important;
    border-radius: 10px 0 0 10px !important;
}

.auth-body .input-group-flat .input-group-text {
    background-color: var(--gm-bg-accent) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-left: none !important;
    border-radius: 0 10px 10px 0 !important;
    color: var(--gm-text-muted);
    transition: border-color 0.2s;
}

/* Quando o input-group está em foco, destaca a borda inteira */
.auth-body .input-group-flat:focus-within .form-control,
.auth-body .input-group-flat:focus-within .input-group-text {
    border-color: rgba(88, 101, 242, 0.6) !important;
}

.auth-body .input-group-flat:focus-within .form-control {
    box-shadow: none !important;
    /* o grupo todo recebe o glow, não o input isolado */
}

.auth-body .input-group-flat:focus-within {
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
    border-radius: 10px;
}

/* Ícone do olho (mostrar senha) */
.auth-body .link-secondary {
    color: var(--gm-text-muted) !important;
}

.auth-body .link-secondary:hover,
.auth-body .link-secondary:focus {
    color: var(--gm-header-primary) !important;
}

/* ── input-group-text prefix (ex: "Guest-" no modo convidado) ── */
.auth-body #pills-guest .input-group-text {
    background-color: var(--gm-bg-tertiary) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--gm-text-muted) !important;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
}

/* ══════════════════════════════════════════════════════════════
   8. BOTÃO PRINCIPAL "Sign in"
   Alvo: button#main-login.btn.btn-dark + button.btn.btn-dark.w-100
   ══════════════════════════════════════════════════════════════ */

/*
 * color_css.css define #main-login { background: #009688 } e
 * .btn-dark { background: #009688 }.
 * Substituímos pelo blurple da landing page.
 */
.auth-body #main-login,
.auth-body .btn-dark.w-100,
.auth-body .form-footer .btn-dark {
    background: var(--gm-blurple) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 28px !important;
    font-family: 'Nunito', sans-serif !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    padding: 12px 24px !important;
    width: 100% !important;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(88, 101, 242, 0.45);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.auth-body #main-login:hover,
.auth-body .btn-dark.w-100:hover,
.auth-body .form-footer .btn-dark:hover {
    background: var(--gm-blurple-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 28px rgba(88, 101, 242, 0.6) !important;
}

.auth-body #main-login:active,
.auth-body .btn-dark.w-100:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35) !important;
}

/* form-footer: remove o margin-top excessivo do Tabler */
.auth-body .form-footer {
    margin-top: 24px;
}

/* ── Botão SSO (btn-primary — presente quando SSO está ativo) ── */
.auth-body .btn-primary {
    background: var(--gm-blurple) !important;
    border: none !important;
    border-radius: 28px !important;
    font-family: 'Nunito', sans-serif !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 18px rgba(88, 101, 242, 0.45);
    transition: all 0.2s;
}

.auth-body .btn-primary:hover {
    background: var(--gm-blurple-dark) !important;
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════
   9. SEPARADOR "Or Sign in With" (social-seperator)
   Alvo: div.social-seperator > hr + div
   ══════════════════════════════════════════════════════════════ */

.auth-body .social-seperator {
    position: relative;
    /* margin: 24px 0; */
    /* text-align: center; */
}

.auth-body .social-seperator hr {
    border-color: var(--gm-border);
    opacity: 1;
    margin: 0;
}

/*
 * color_css.css define .social-seperator div { background: #313338 }
 * Atualizamos para var(--gm-bg-secondary) pois agora estamos dentro do card.
 */
.auth-body .social-seperator div {
    display: inline-block;
    position: relative;
    top: -12px;
    background: var(--gm-bg-secondary) !important;
    padding: 0 12px;
    color: var(--gm-text-muted) !important;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Ícones de login social ─────────────────────────────────── */
.auth-body .social-login-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-body .social-provider a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--gm-bg-accent);
    border: 1px solid var(--gm-border);
    border-radius: 12px;
    transition: all 0.2s;
}

.auth-body .social-provider a:hover {
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.4);
    transform: translateY(-2px);
}

.auth-body .social-provider img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* ══════════════════════════════════════════════════════════════
   10. DIVISOR E LINKS DO RODAPÉ DO FORM
   Alvo: hr + div.text-center com links "Criar conta" / "Voltar"
   ══════════════════════════════════════════════════════════════ */

.auth-body .container.container-tight>hr,
.auth-body .container.container-tight form+hr {
    border-color: var(--gm-border);
    opacity: 1;
    margin: 20px 0;
}

/* Remove o <hr> que vem antes dos links do rodapé pois o card já tem separação visual */
.auth-body .container.container-tight>hr:last-of-type {
    margin-top: 30px;
}

/* Links de rodapé (criar conta / voltar) */
.auth-body .container.container-tight .text-center.text-center a.small,
.auth-body .container.container-tight>.text-center a {
    color: var(--gm-text-muted) !important;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.auth-body .container.container-tight .text-center a.small:hover,
.auth-body .container.container-tight>.text-center a:hover {
    color: var(--gm-blurple) !important;
}

/* ══════════════════════════════════════════════════════════════
   11. ALERTAS / MENSAGENS DO SISTEMA (msg())
   Alvo: divs de alerta geradas pelo {{ msg() }} do template
   (classes típicas do Tabler: .alert, .alert-danger, .alert-success)
   ══════════════════════════════════════════════════════════════ */

.auth-body .alert {
    border-radius: 12px;
    border: 1px solid;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.auth-body .alert-danger {
    background: rgba(237, 66, 69, 0.12) !important;
    border-color: rgba(237, 66, 69, 0.3) !important;
    color: #ff9091 !important;
}

.auth-body .alert-success {
    background: rgba(87, 242, 135, 0.10) !important;
    border-color: rgba(87, 242, 135, 0.28) !important;
    color: #57F287 !important;
}

.auth-body .alert-warning {
    background: rgba(254, 231, 92, 0.10) !important;
    border-color: rgba(254, 231, 92, 0.28) !important;
    color: var(--gm-yellow) !important;
}

.auth-body .alert-info {
    background: rgba(88, 101, 242, 0.12) !important;
    border-color: rgba(88, 101, 242, 0.3) !important;
    color: #a8b4ff !important;
}

/* ══════════════════════════════════════════════════════════════
   12. reCAPTCHA — neutraliza o fundo branco padrão
   ══════════════════════════════════════════════════════════════ */

.auth-body .g-recaptcha {
    margin-bottom: 16px;
    /* O iframe do reCAPTCHA não pode ser estilizado diretamente,
     mas o container ao redor pode ter a cor de fundo correta */
    background: transparent;
}

/* ══════════════════════════════════════════════════════════════
   13. SELECT2 (seletor de país no modo convidado)
   Alvo: .select2-container (já parcialmente coberto pelo color_css)
   ══════════════════════════════════════════════════════════════ */

.auth-body .select2-container--bootstrap4 .select2-selection {
    background-color: var(--gm-bg-accent) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    border-radius: 10px !important;
    color: var(--gm-text-normal) !important;
    min-height: 42px;
}

.auth-body .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    color: var(--gm-text-normal) !important;
    line-height: 42px;
}

.auth-body .select2-dropdown {
    background-color: var(--gm-bg-secondary) !important;
    border: 1px solid var(--gm-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-body .select2-results__option--highlighted {
    background-color: var(--gm-blurple) !important;
    border-radius: 6px;
}

/* ══════════════════════════════════════════════════════════════
   14. FORM CHECK (checkboxes, se presentes)
   ══════════════════════════════════════════════════════════════ */

.auth-body .form-check-input {
    background-color: var(--gm-bg-accent) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.auth-body .form-check-input:checked {
    background-color: var(--gm-blurple) !important;
    border-color: var(--gm-blurple) !important;
}

/* ══════════════════════════════════════════════════════════════
   15. ANIMAÇÃO DE ENTRADA DO CARD
   O container-tight aparece com fade + slide up, igual ao popup
   ══════════════════════════════════════════════════════════════ */

@keyframes gmCardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-body .container.container-tight {
    animation: gmCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ══════════════════════════════════════════════════════════════
   16. SCROLLBAR (consistência com o restante do sistema)
   Já coberto pelo color_css.css, mas reforçado para a auth page
   ══════════════════════════════════════════════════════════════ */

.auth-body *::-webkit-scrollbar {
    width: 6px;
}

.auth-body *::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 3px;
}

.auth-body *::-webkit-scrollbar-track {
    background: transparent;
}

/* ══════════════════════════════════════════════════════════════
   17. RESPONSIVO — Mobile
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 576px) {
    .auth-body .container.container-tight {
        border-radius: 16px;
        padding: 28px 20px !important;
        margin: 16px !important;
        max-width: calc(100% - 32px) !important;
    }

    .auth-body .container.container-tight::before {
        left: 20px;
        right: 20px;
    }

    .auth-body h2.h3,
    .auth-body .h3 {
        font-size: 22px !important;
    }
}