.auth-page {
    position: relative;
    overflow: hidden;
    min-height: calc(100svh - var(--ap-header-h));
    background:
        radial-gradient(circle at 82% 9%, rgba(21,152,255,.18), transparent 30rem),
        radial-gradient(circle at 10% 72%, rgba(94,231,255,.08), transparent 25rem),
        linear-gradient(160deg, #061727 0%, #082035 48%, #f4f8fc 48.1%, #f4f8fc 100%);
}
.auth-page::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, #000, transparent 68%);
}
.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 24px;
    padding-top: 30px;
    padding-bottom: 50px;
}
.auth-visual {
    color: #fff;
    padding: 12px 3px 4px;
}
.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8dd9ff;
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.auth-kicker::before {
    content: "";
    width: 24px;
    height: 2px;
    border-radius: 99px;
    background: var(--ap-primary);
    box-shadow: 0 0 14px rgba(21,152,255,.7);
}
.auth-visual h1 {
    max-width: 660px;
    margin: 13px 0 12px;
    font-size: clamp(2rem, 9vw, 3.35rem);
    line-height: 1.01;
    letter-spacing: -.05em;
}
.auth-visual p {
    max-width: 580px;
    margin: 0;
    color: #a9c0d1;
    font-size: .96rem;
}
.auth-visual__points {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 21px;
}
.auth-point {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dcebf5;
    font-size: .88rem;
}
.auth-point__icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(94,231,255,.20);
    border-radius: 9px;
    background: rgba(21,152,255,.11);
    color: #74dbff;
}
.auth-point__icon svg { width: 15px; height: 15px; fill: currentColor; }

.auth-card {
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    padding: 22px 18px;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(219,231,240,.96);
    border-radius: 21px;
    box-shadow: var(--ap-shadow);
}
.auth-card__head { margin-bottom: 19px; }
.auth-card__head span {
    color: var(--ap-primary-strong);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.auth-card__head h2 {
    margin: 5px 0 5px;
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: -.035em;
}
.auth-card__head p { margin: 0; color: var(--ap-muted); font-size: .88rem; }
.auth-alerts { display: grid; gap: 9px; margin-bottom: 16px; }

.auth-form { display: grid; gap: 14px; }
.auth-row { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; }
.auth-label {
    font-size: .82rem;
    font-weight: 720;
    color: #24394a;
}
.auth-input-wrap { position: relative; }
.auth-input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cfdeea;
    border-radius: 12px;
    padding: 11px 13px;
    background: #fbfdff;
    color: #112639;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-input::placeholder { color: #9aabba; }
.auth-input:focus {
    border-color: #5ab9ff;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(21,152,255,.11);
}
.auth-input--password { padding-right: 73px; }
.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--ap-primary-strong);
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
    min-height: 34px;
    padding: 6px 7px;
}
.auth-help { color: #8295a5; font-size: .75rem; }
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.auth-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    color: #5e7384;
    font-size: .78rem;
}
.auth-check input { margin-top: 3px; accent-color: var(--ap-primary); }
.auth-link {
    color: var(--ap-primary-strong);
    font-size: .79rem;
    font-weight: 750;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-submit {
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ap-primary), #087ce0);
    color: #fff;
    font-weight: 820;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(21,152,255,.24);
    transition: transform .18s ease, box-shadow .18s ease;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 15px 32px rgba(21,152,255,.3); }
.auth-submit:active { transform: translateY(0); }
.auth-bottom {
    margin: 17px 0 0;
    padding-top: 15px;
    border-top: 1px solid #e7eff5;
    color: #748798;
    font-size: .8rem;
    text-align: center;
}

.auth-type-grid { display: grid; gap: 10px; }
.auth-type { position: relative; }
.auth-type input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.auth-type label {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid #d7e4ed;
    border-radius: 13px;
    background: #fbfdff;
    cursor: pointer;
    transition: .18s ease;
}
.auth-type__icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--ap-primary-soft);
    color: var(--ap-primary-strong);
}
.auth-type__icon svg { width: 20px; height: 20px; fill: currentColor; }
.auth-type strong { display: block; font-size: .86rem; }
.auth-type small { display: block; color: #7f92a1; font-size: .72rem; margin-top: 2px; }
.auth-type input:checked + label {
    border-color: #57b9ff;
    background: #f2faff;
    box-shadow: 0 0 0 3px rgba(21,152,255,.09);
}

.auth-dev-box {
    margin-top: 14px;
    padding: 13px;
    border: 1px dashed #f0c76b;
    border-radius: 12px;
    background: #fffaf0;
    color: #71510b;
    font-size: .78rem;
    overflow-wrap: anywhere;
}
.auth-dev-box a { color: #855b00; font-weight: 800; }

@media (min-width: 560px) {
    .auth-card { padding: 28px; }
    .auth-row--2 { grid-template-columns: 1fr 1fr; }
    .auth-type-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 920px) {
    .auth-page {
        min-height: calc(100vh - var(--ap-header-h));
        display: grid;
        align-items: center;
        background:
            radial-gradient(circle at 80% 18%, rgba(21,152,255,.14), transparent 25rem),
            linear-gradient(90deg, #061727 0%, #082238 49.5%, #f4f8fc 49.6%, #f4f8fc 100%);
    }
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
        align-items: center;
        gap: clamp(48px, 7vw, 100px);
        padding-top: 58px;
        padding-bottom: 58px;
    }
    .auth-visual { padding: 0; }
    .auth-visual__points { grid-template-columns: 1fr 1fr; max-width: 570px; }
    .auth-card { margin: 0; }
}


/* ============================================================
   VERIFICAÇÃO / ATIVAÇÃO DE E-MAIL
============================================================ */
.auth-verify-box {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin: 4px 0 18px;
    padding: 15px;
    border: 1px solid #d8e8f3;
    border-radius: 13px;
    background: #f7fbfe;
}
.auth-verify-box__icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--ap-primary-soft);
    color: var(--ap-primary-strong);
    font-size: 1.15rem;
    font-weight: 900;
}
.auth-verify-box strong {
    display: block;
    margin-top: 1px;
    font-size: .9rem;
}
.auth-verify-box p {
    margin: 4px 0 0;
    color: var(--ap-muted);
    font-size: .78rem;
    line-height: 1.55;
}
.auth-submit--secondary {
    background: #0b2940;
    box-shadow: 0 10px 25px rgba(6,23,39,.16);
}
.auth-action-link {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ap-primary), #087ce0);
    color: #fff;
    text-decoration: none;
    font-weight: 820;
    box-shadow: 0 12px 28px rgba(21,152,255,.24);
}


/* ============================================================
   LOGIN + NOVO HEADER/FOOTER PÚBLICO
   Compatibilidade com public/includes/header.php
============================================================ */
body.auth-layout {
    --ap-primary: #1598ff;
    --ap-primary-strong: #087fd5;
    --ap-primary-soft: #e8f5ff;
    --ap-muted: #607384;
    --ap-shadow: 0 22px 60px rgba(8,35,57,.14);
}

/*
 * Nas páginas de autenticação o header não deve ficar absoluto
 * sobre o formulário. Ele ganha fundo próprio e ocupa seu espaço.
 */
body.auth-layout .home-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    background:
        radial-gradient(circle at 82% 0%, rgba(28,139,211,.16), transparent 30%),
        #071521;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

/* O login começa abaixo do header, sem sobreposição. */
body.auth-layout .auth-page {
    min-height: auto;
}

/* Mantém o formulário dentro da largura oficial do site. */
body.auth-layout .auth-shell {
    width: min(1440px, calc(100% - 48px));
    margin-inline: auto;
}

/* Botão sempre legível mesmo sem variáveis antigas globais. */
body.auth-layout .auth-submit,
body.auth-layout .auth-action-link {
    background: linear-gradient(135deg, #1598ff, #087ce0);
    color: #fff;
}

/* Corrige qualquer herança visual do header antigo. */
body.auth-layout .auth-card {
    color: #0b1c2b;
}

@media (min-width: 920px) {
    body.auth-layout .auth-page {
        min-height: 620px;
    }

    body.auth-layout .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
        gap: clamp(42px, 6vw, 90px);
        padding-top: 54px;
        padding-bottom: 54px;
    }

    body.auth-layout .auth-visual h1 {
        font-size: clamp(2.8rem, 4.3vw, 4.6rem);
        max-width: 680px;
    }
}

@media (max-width: 960px) {
    body.auth-layout .home-header {
        position: relative;
    }

    body.auth-layout .home-mobile-nav {
        position: absolute;
    }
}

@media (max-width: 640px) {
    body.auth-layout .auth-shell {
        width: calc(100% - 22px);
        padding-top: 28px;
        padding-bottom: 36px;
    }

    body.auth-layout .auth-page {
        background:
            radial-gradient(circle at 82% 9%, rgba(21,152,255,.16), transparent 24rem),
            linear-gradient(180deg, #061727 0, #082035 39%, #f4f8fc 39.1%, #f4f8fc 100%);
    }

    body.auth-layout .auth-visual h1 {
        font-size: clamp(2.15rem, 11vw, 3.1rem);
    }

    body.auth-layout .auth-card {
        padding: 22px 18px;
    }
}
