/* ==========================================================================
   auth.css  —  Telas do fluxo de acesso

   Cadastro, confirmacao de cadastro, recuperacao e alteracao de senha,
   reenvio de confirmacao de e-mail.

   Antes cada uma dessas views carregava o proprio bloco <style> com,
   essencialmente, o mesmo CSS (cerca de 1.000 linhas duplicadas) e duas
   delas usavam nomes diferentes (.login-card/.login-wrapper) para o mesmo
   componente. Aqui existe um unico conjunto de classes, com modificadores
   para as variacoes reais.

   A tela de Login tem visual proprio e continua em css/login.css.
   ========================================================================== */

.auth-wrapper {
    --auth-brand: #1D9E75;
    --auth-brand-dark: #168760;
    --auth-brand-light: #E6F6F0;
    --auth-ink: #0F172A;
    --auth-muted: #64748B;
    --auth-borda: #CED4DA;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    overflow: hidden;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(29, 158, 117, .18), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, #f3f9f6 100%);
}

/* Malha decorativa de fundo. */
.auth-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15, 23, 42, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse at center, #000 35%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 70%);
}

/* Quando a tela e renderizada DENTRO do shell autenticado (Alterar Senha,
   quando o layout escolhe o shell "produto"), ocupar 100vh empurraria o
   conteudo e duplicaria o fundo. A adaptacao e automatica pelo contexto,
   sem a view precisar saber em qual shell esta. */
.poc-conteudo .auth-wrapper {
    min-height: auto;
    padding: 1rem 0 2rem;
    background: none;
}
.poc-conteudo .auth-wrapper::before { display: none; }

/* ==========================================================================
   Cartao
   ========================================================================== */

.auth-wrapper .auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 2.25rem 2rem;
    border: 1px solid #EEF2F0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}

.auth-wrapper .auth-card--medio { max-width: 480px; }
.auth-wrapper .auth-card--largo { max-width: 560px; }
.auth-wrapper .auth-card--centrado { text-align: center; }

.auth-wrapper .auth-logo {
    display: block;
    max-width: 200px;
    height: auto;
    margin: 0 auto 1.25rem;
}
.auth-wrapper .auth-logo--pequeno { max-width: 180px; }

.auth-wrapper .auth-card h2 {
    margin: 0 0 .35rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--auth-ink);
    text-align: center;
}

.auth-wrapper .auth-card .subtitle {
    margin-bottom: 1.5rem;
    font-size: .93rem;
    line-height: 1.55;
    color: var(--auth-muted);
    text-align: center;
}

.auth-wrapper .auth-foot {
    margin-top: 1.5rem;
    font-size: .8rem;
    color: var(--auth-muted);
    text-align: center;
}

/* ==========================================================================
   Campos
   ========================================================================== */

.auth-wrapper .auth-card .form-label {
    margin-bottom: .35rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--auth-ink);
}

.auth-wrapper .auth-card .form-control,
.auth-wrapper .auth-card .form-select {
    height: 48px;
    border-radius: 10px;
    font-size: 1rem;
}

    .auth-wrapper .auth-card .form-control:focus,
    .auth-wrapper .auth-card .form-select:focus {
        border-color: var(--auth-brand);
        box-shadow: 0 0 0 .15rem rgba(29, 158, 117, .18);
    }

/* Grupos de campo: o prefixo (icone) e o sufixo (mostrar senha) sao
   tratados juntos, para atender tanto as telas que usam .input-group-text
   quanto as que usam um <button> como sufixo. */
.auth-wrapper .auth-card .input-group { height: 48px; }

    .auth-wrapper .auth-card .input-group > .form-control,
    .auth-wrapper .auth-card .input-group > .input-group-text,
    .auth-wrapper .auth-card .input-group > .btn,
    .auth-wrapper .auth-card .input-group > .toggle-password {
        height: 48px;
        font-size: 1rem;
    }

.auth-wrapper .auth-card .input-group-text {
    padding: 0 .85rem;
    border-right: 0;
    background: #fff;
    color: var(--auth-muted);
}

.auth-wrapper .auth-card .input-group > .form-control:not(:first-child) { border-left: 0; }

/* O arredondamento fica nas pontas do grupo, seja qual for o elemento. */
.auth-wrapper .auth-card .input-group > :first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.auth-wrapper .auth-card .input-group > :last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.auth-wrapper .auth-card .input-group:focus-within .input-group-text {
    border-color: var(--auth-brand);
    color: var(--auth-brand);
}

.auth-wrapper .auth-card .input-group-text svg { width: 18px; height: 18px; }

/* Botao de mostrar/ocultar senha. Cada tela nomeia o botao de um jeito
   (.toggle-password, .toggle-pwd, so .btn), entao a regra cobre qualquer
   botao usado como sufixo do input-group. */
.auth-wrapper .auth-card .input-group > .btn,
.auth-wrapper .auth-card .toggle-password {
    padding: 0 .85rem;
    border: 1px solid var(--auth-borda);
    border-left: 0;
    background: #fff;
    color: var(--auth-muted);
    cursor: pointer;
}

    .auth-wrapper .auth-card .input-group > .btn:hover,
    .auth-wrapper .auth-card .toggle-password:hover { color: var(--auth-brand); background: #fff; }
    .auth-wrapper .auth-card .input-group > .btn:focus-visible,
    .auth-wrapper .auth-card .toggle-password:focus-visible {
        outline: 2px solid var(--auth-brand);
        outline-offset: -2px;
    }
    .auth-wrapper .auth-card .input-group > .btn svg,
    .auth-wrapper .auth-card .toggle-password svg { width: 20px; height: 20px; }

/* ==========================================================================
   Acoes
   ========================================================================== */

.auth-wrapper .auth-card .btn-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--auth-brand);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

    .auth-wrapper .auth-card .btn-brand:hover {
        background: var(--auth-brand-dark);
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(29, 158, 117, .28);
    }

    .auth-wrapper .auth-card .btn-brand:active { transform: none; }

    .auth-wrapper .auth-card .btn-brand:focus-visible {
        outline: 2px solid var(--auth-brand-dark);
        outline-offset: 2px;
    }

.auth-wrapper .auth-card .btn-primary,
.auth-wrapper .auth-card .btn-outline-secondary {
    height: 48px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.auth-wrapper .auth-card a {
    color: var(--auth-brand-dark);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
}

    .auth-wrapper .auth-card a:hover {
        color: var(--auth-brand);
        text-decoration: underline;
    }

.auth-wrapper .auth-card .alert {
    border-radius: 10px;
    font-size: .9rem;
}

/* ==========================================================================
   Blocos auxiliares
   ========================================================================== */

/* Circulo com icone das telas de confirmacao. */
.auth-wrapper .icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--auth-brand-light);
    color: var(--auth-brand);
}

    .auth-wrapper .icon-circle svg { width: 40px; height: 40px; }

/* Aviso destacado dentro do cartao. */
.auth-wrapper .info-note,
.auth-wrapper .info-box {
    margin-bottom: 1.5rem;
    padding: .85rem 1rem;
    border-left: 4px solid var(--auth-brand);
    border-radius: 8px;
    font-size: .85rem;
    text-align: left;
}

.auth-wrapper .info-note {
    background: var(--auth-brand-light);
    color: #14532D;
}

.auth-wrapper .info-box {
    background: #F8FAF9;
    color: #495057;
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media (max-width: 480px) {
    .auth-wrapper { padding: 1.25rem .75rem; }

    .auth-wrapper .auth-card {
        padding: 1.75rem 1.25rem;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .auth-wrapper .auth-card h2 { font-size: 1.3rem; }
}
