/* =====================================================================
   CHECKPOINT REGISTER.1 — folha dedicada, page-scoped (.cg-register-*),
   carregada SOMENTE por resources/views/auth/register.blade.php
   (/register).

   Arquitetura irmã de login_auth.css (LOGIN.3B/3C), mas NÃO importa nem
   reaproveita classes de lá — cada página de auth tem sua própria folha
   isolada (login_auth.css não é tocado/referenciado aqui, por instrução
   explícita). O idioma visual (paleta preto/vermelho, tipografia,
   tratamento de input/botão, filosofia de espaçamento e breakpoint) foi
   replicado manualmente para o namespace .cg-register-* a partir da
   implementação aprovada de /telalogin.

   Diferença estrutural chave em relação a /telalogin: /register tem 6
   campos + 2 consentimentos, então NÃO cabe em uma tela sem scroll no
   mobile (isso é esperado, ver checkpoint REGISTER.1). Por isso o painel
   visual mobile usa `position:fixed` (em vez do `position:absolute` de
   /telalogin) — assim ele permanece como pano de fundo fixo enquanto o
   formulário rola por cima, sem esticar/recortar a imagem de fundo.

   Duas exceções que precisam de neutralização explícita porque miram
   seletores de ELEMENTO/ID do style-inicial.css compartilhado (não de
   classe, que já são neutralizados só por não serem reaproveitados):
   1) `main { width: fit-content; }` em @media(max-width:450px) — mesma
      causa raiz provada em LOGIN.2D/LOGIN.3B. Corrigido abaixo com
      `body main` (especificidade 0,0,0,2 > 0,0,0,1).
   2) `input#email, input#password, input#name, input#telefone,
      input#apelido, input#password-confirm { ... }` em style-inicial.css
      é um conjunto de seletores de ID. Em vez de brigar por
      especificidade, todos os inputs desta página usam ids novos com
      prefixo cg-register- (cg-register-email, cg-register-password,
      etc.), que simplesmente não existem no CSS legado — zero colisão.
   ===================================================================== */

@media (max-width: 450px) {
    body main {
        width: 100%;
    }
}

.cg-register {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: #000;
    font-family: inherit;
}

/* ---------------------------------------------------------------------
   PAINEL VISUAL (banner-login-horizontal.webp)
   Mobile: camada de fundo fixa (position:fixed) atrás do painel de
   cadastro, que rola normalmente por cima — nunca uma segunda seção
   promocional empilhada abaixo do formulário.
   Desktop (>=992px): coluna real à esquerda, ~56% da largura, sticky
   para acompanhar o painel de cadastro caso ele seja mais alto que a
   viewport.
   --------------------------------------------------------------------- */
.cg-register-visual {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.cg-register-visual__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, .80) 0%,
        rgba(0, 0, 0, .72) 40%,
        rgba(0, 0, 0, .92) 100%);
}

.cg-register-visual__brand {
    display: none; /* conteúdo de marca do painel visual só aparece no desktop */
}

/* ---------------------------------------------------------------------
   PAINEL DE CADASTRO
   Mobile: ocupa 100% da largura, rola naturalmente (esperado — 6 campos
   + 2 consentimentos não cabem em uma tela).
   --------------------------------------------------------------------- */
.cg-register-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    /* CHECKPOINT REGISTER.2 — 20px/40px → 16px/28px (topo/base). Desktop
       já redeclara padding:28px 56px 40px por completo, então não é
       afetado. */
    padding: 16px 20px 28px;
    box-sizing: border-box;
}

.cg-register-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cg-register-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #fff;
    font-size: 18px;
    text-decoration: none;
    flex-shrink: 0;
}

.cg-register-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cg-register-switch span {
    color: rgba(255, 255, 255, .65);
    font-size: 12px;
    white-space: nowrap;
}

.cg-register-switch__btn {
    background: var(--cg-register-accent, #B31212);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.cg-register-form-wrap {
    width: 100%;
    max-width: 380px;
    /* CHECKPOINT REGISTER.2 — 24px → 8px (menos espaço vazio acima do
       logo/título no mobile). Desktop já redeclara margin-top:12px
       explicitamente, então não é afetado. */
    margin: 8px auto 0;
}

.cg-register-form-wrap__logo-mobile {
    /* CHECKPOINT REGISTER.2 — 82px → 64px, margin-bottom 20px → 12px
       (densidade mobile). Desktop esconde este logo (display:none),
       então não é afetado. */
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}

.cg-register-title {
    margin: 0 0 6px;
    color: #fff;
    font-family: 'Bungee', cursive;
    font-size: 22px;
    font-weight: 400;
    text-transform: uppercase;
    text-align: center;
}

.cg-register-subtitle {
    /* CHECKPOINT REGISTER.2 — 24px → 12px. Desktop já redeclara
       margin-bottom:20px explicitamente, então não é afetado. */
    margin: 0 0 12px;
    color: rgba(255, 255, 255, .65);
    font-size: 14px;
    text-align: center;
}

.cg-register-form {
    display: flex;
    flex-direction: column;
    /* CHECKPOINT REGISTER.2 — 16px → 12px. Desktop já redeclara
       gap:14px explicitamente, então não é afetado. */
    gap: 12px;
}

.cg-register-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    /* CHECKPOINT REGISTER.2 — 16px → 12px. Desktop já redeclara
       gap:14px explicitamente, então não é afetado. */
    gap: 12px;
}

/* CHECKPOINT REGISTER.2 — força 2 colunas SÓ na linha Senha/Confirmar
   senha no mobile, igual ao mockup aprovado. Nome/Apelido/E-mail/
   WhatsApp continuam 1 coluna (full width) via .cg-register-row-2 base,
   inalterado. Ver comentário no Blade sobre por que precisou de uma
   classe modificadora em vez de um seletor CSS posicional. */
.cg-register-row-2--password {
    grid-template-columns: 1fr 1fr;
}

.cg-register-field {
    display: flex;
    flex-direction: column;
    /* CHECKPOINT REGISTER.2 — 6px → 4px. SEM equivalente de desktop
       antes desta mudança — reset explícito adicionado no bloco
       @media(min-width:992px) abaixo para manter o desktop em 6px,
       pixel-equivalente ao estado pré-checkpoint. */
    gap: 4px;
}

.cg-register-field label {
    color: rgba(255, 255, 255, .75);
    font-size: 13px;
    font-weight: 600;
}

.cg-register-input {
    width: 100%;
    /* CHECKPOINT REGISTER.2 — 48px → 54px, dentro da faixa 52-56px
       pedida no checkpoint. Desktop já redeclara height:44px
       explicitamente, então não é afetado. */
    height: 54px;
    padding: 0 16px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    box-sizing: border-box;
}

.cg-register-input::placeholder {
    color: rgba(255, 255, 255, .35);
}

.cg-register-input:focus {
    outline: none;
    border-color: var(--cg-register-accent, #B31212);
    box-shadow: 0 0 0 3px rgba(179, 18, 18, .18);
}

.cg-register-input.is-invalid {
    border-color: #ff4d4d;
}

/* CHECKPOINT AUTH.1 — toggle de visibilidade de senha (Senha e Confirmar
   senha, cada um com seu próprio botão/id — operam de forma totalmente
   independente). O wrapper só existe para posicionar o botão via
   position:absolute dentro do campo; não altera altura/fluxo do input.
   padding-right extra garante que o texto digitado nunca passe por baixo
   do ícone. */
.cg-register-input-wrap {
    position: relative;
}

.cg-register-input--pw {
    padding-right: 48px;
}

.cg-register-toggle-pass {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: rgba(255, 255, 255, .55);
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
}

.cg-register-toggle-pass:hover {
    color: rgba(255, 255, 255, .85);
}

.cg-register-toggle-pass:focus-visible {
    outline: none;
    color: rgba(255, 255, 255, .85);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .25);
}

.cg-register-error {
    display: block;
    color: #ff8080;
    font-size: 12px;
}

.cg-register-consents {
    display: flex;
    flex-direction: column;
    /* CHECKPOINT REGISTER.2 — 12px → 8px. SEM equivalente de desktop
       antes desta mudança — reset explícito adicionado no bloco
       @media(min-width:992px) abaixo para manter o desktop em 12px. */
    gap: 8px;
    margin-top: 4px;
}

.cg-register-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cg-register-consent input {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    flex-shrink: 0;
    accent-color: var(--cg-register-accent, #B31212);
}

.cg-register-consent label {
    color: rgba(255, 255, 255, .75);
    /* CHECKPOINT REGISTER.2 — 12.5px/1.5 → 11.5px/1.35 (fonte menor,
       porém legível, e line-height mais compacto, conforme pedido).
       SEM equivalente de desktop antes desta mudança — reset explícito
       adicionado no bloco @media(min-width:992px) abaixo para manter o
       desktop em 12.5px/1.5. Texto legal preservado 100% — só CSS. */
    font-size: 11.5px;
    line-height: 1.35;
}

.cg-register-consent label a {
    color: var(--cg-register-accent, #B31212);
    text-decoration: underline;
}

.cg-register-submit {
    width: 100%;
    /* CHECKPOINT REGISTER.2 — 50px → 54px, dentro da faixa 52-56px
       pedida no checkpoint. Desktop já redeclara height:46px
       explicitamente, então não é afetado. */
    height: 54px;
    margin-top: 4px;
    background: var(--cg-register-accent, #B31212);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    cursor: pointer;
}

.cg-register-submit:hover {
    filter: brightness(1.08);
}

.cg-register-footer {
    /* CHECKPOINT REGISTER.2 — 24px → 12px. SEM equivalente de desktop
       antes desta mudança — reset explícito adicionado no bloco
       @media(min-width:992px) abaixo para manter o desktop em 24px. */
    margin: 12px auto 0;
    color: rgba(255, 255, 255, .4);
    font-size: 11px;
    text-align: center;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    .cg-register-submit {
        transition: none;
    }
}

/* =====================================================================
   DESKTOP (>=992px) — split-screen: ~56% visual / ~44% cadastro
   ===================================================================== */
@media (min-width: 992px) {
    .cg-register {
        flex-direction: row;
    }

    .cg-register-visual {
        position: sticky;
        inset: auto;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        flex: 0 0 56%;
        max-width: 56%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 64px;
        box-sizing: border-box;
    }

    .cg-register-visual__overlay {
        background: linear-gradient(90deg,
            rgba(0, 0, 0, .55) 0%,
            rgba(0, 0, 0, .25) 45%,
            rgba(0, 0, 0, .55) 100%);
    }

    .cg-register-visual__brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        z-index: 1;
        text-align: center;
        max-width: 420px;
    }

    .cg-register-visual__logo {
        width: 132px;
        height: 132px;
        object-fit: contain;
        margin-bottom: 24px;
    }

    .cg-register-visual__tagline {
        margin: 0;
        color: #fff;
        font-family: 'Bungee', cursive;
        font-size: 25px;
        line-height: 1.4;
        text-transform: uppercase;
        text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
    }

    .cg-register-visual__tagline span {
        display: block;
    }

    .cg-register-panel {
        flex: 0 0 44%;
        max-width: 44%;
        min-height: 100vh;
        background: #0a0a0a;
        padding: 28px 56px 40px;
    }

    .cg-register-form-wrap {
        max-width: 460px;
        margin-top: 12px;
    }

    .cg-register-form-wrap__logo-mobile {
        display: none; /* desktop já mostra a marca no painel visual */
    }

    .cg-register-title {
        font-size: 26px;
        text-align: left;
    }

    .cg-register-subtitle {
        text-align: left;
        font-size: 14px;
        margin-bottom: 20px;
    }

    .cg-register-switch span {
        font-size: 13px;
    }

    .cg-register-form {
        gap: 14px;
    }

    .cg-register-row-2 {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .cg-register-input {
        height: 44px;
    }

    .cg-register-submit {
        height: 46px;
    }

    /* CHECKPOINT REGISTER.2 — resets explícitos para as propriedades que
       antes desta checkpoint não tinham override de desktop e por isso
       teriam herdado os novos valores mobile-only. Valores abaixo são os
       mesmos que já existiam no desktop antes deste checkpoint —
       desktop permanece pixel-equivalente. */
    .cg-register-field {
        gap: 6px;
    }

    .cg-register-consents {
        gap: 12px;
    }

    .cg-register-consent label {
        font-size: 12.5px;
        line-height: 1.5;
    }

    .cg-register-footer {
        margin: 24px auto 0;
    }
}

@media (min-width: 1440px) {
    .cg-register-panel {
        padding-left: 72px;
        padding-right: 72px;
    }
}
