/* ====== Tela de login Pincel Atômico — split screen (portada do portal do aluno) ====== */
:root {
    --pa-primary: #089e60;
    --pa-primary-hover: #0ea064;
    --pa-secondary: #1396cc;
    --pa-grad: linear-gradient(135deg, #089e60 0%, #1396cc 100%);
    --pa-ink: #1f2d3d;
    --pa-muted: #7b8794;
    --pa-border: #e3e8ee;
    --pa-bg: #f4f7fa;
    --pa-danger: #e04338;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body.auth-page {
    margin: 0;
    font-family: "Open Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--pa-ink);
    background: var(--pa-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.pa-wrap { min-height: 100vh; display: flex; }

/* ----- Coluna esquerda: marca / banners ----- */
.pa-brand {
    flex: 1 1 55%;
    position: relative;
    background: var(--pa-grad);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}

.pa-brand::after { /* textura sutil */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .12), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, .10), transparent 40%);
    pointer-events: none;
}

.pa-brand-inner { position: relative; z-index: 2; text-align: center; max-width: 520px; width: 100%; }
.pa-brand-inner h1 { font-size: 30px; font-weight: 700; margin: 0 0 12px; }
.pa-brand-inner p { font-size: 16px; opacity: .92; margin: 0; }

.pa-emp-logo {
    max-width: 220px;
    max-height: 120px;
    margin: 0 auto 26px;
    display: block;
    background: #fff;
    padding: 16px 22px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .15);
}

/* banners rotativos ocupam TODA a coluna esquerda (full-bleed) */
.pa-banners { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; margin: 0; z-index: 1; background: var(--pa-grad); }
.pa-banner { position: absolute; inset: 0; display: none; overflow: hidden; }
.pa-banner.active { display: block; }
.pa-banner .pa-banner-img {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

/* logo da empresa sobreposta ao banner (canto sup. esquerdo) */
.pa-emp-logo-overlay {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 3;
    max-width: 190px;
    max-height: 76px;
    background: rgba(255, 255, 255, .94);
    padding: 9px 15px;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

/* ----- Coluna direita: form ----- */
.pa-panel {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.pa-card { width: 100%; max-width: 400px; }
.pa-sys-logo { display: block; margin: 0 auto 26px; max-width: 230px; width: 70%; }
/* Logo da empresa no topo do form — só aparece no mobile quando há logo (ver .tem-logo-empresa) */
.pa-emp-logo-mobile { display: none; }
.pa-card h2 { font-size: 22px; font-weight: 700; margin: 0 0 24px; text-align: center; color: var(--pa-ink); }

/* subtítulo e link "voltar ao login" do bloco de recuperar senha */
.blocoRecuperar h2 { margin-bottom: 8px; }
.pa-sub { font-size: 13px; color: var(--pa-muted); text-align: center; margin: 0 0 22px; line-height: 1.5; }
.pa-back { text-align: center; margin-top: 18px; }
.pa-back .textLinkInput { margin: 0; }
/* "Não tem conta? Criar conta" — só no login com marca de produto que tem site de cadastro (includes/marca_login.php) */
.pa-criar-conta { text-align: center; margin: 18px 0 0; font-size: 14px; color: var(--pa-muted); }
.pa-criar-conta a { color: var(--pa-primary); font-weight: 600; text-decoration: none; }
.pa-criar-conta a:hover { text-decoration: underline; }

.pa-field { position: relative; margin-bottom: 16px; }
.pa-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--pa-ink); }
.pa-field input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 14px;
    border: 1.5px solid var(--pa-border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--pa-ink);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.pa-field input:focus {
    outline: none;
    border-color: var(--pa-primary);
    box-shadow: 0 0 0 3px rgba(8, 158, 96, .15);
}

/* olho de mostrar/ocultar senha (<button class="toggle-senha">, gancho do JS): área de toque de 44px (mínimo do iOS),
   centrada no input de 48px */
.pa-ic {
    position: absolute;
    right: 2px;
    top: 27px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pa-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 2;
}
.pa-ic:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: -4px; border-radius: 8px; }

/* checkbox "Lembrar Usuário" + link esqueci senha */
.pa-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--pa-ink);
    margin: 4px 0 18px;
    cursor: pointer;
}
.pa-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--pa-primary);
    cursor: pointer;
    margin: 0;
}
.pa-check span { user-select: none; }

.textLinkInput {
    font-size: 12px;
    color: var(--pa-muted);
    text-align: right;
    cursor: pointer;
    margin-left: auto;
    text-decoration: none;
}
.textLinkInput:hover { color: var(--pa-primary); text-decoration: underline; }

.pa-btn {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 10px;
    background: var(--pa-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background .15s, transform .05s;
}
.pa-btn:hover { background: var(--pa-primary-hover); }
.pa-btn:active { transform: translateY(1px); }
.pa-btn[disabled] { opacity: .7; cursor: not-allowed; }

.pa-spin {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pa-rot .7s linear infinite;
    display: none;
}
@keyframes pa-rot { to { transform: rotate(360deg); } }

.pa-links { display: flex; justify-content: space-around; gap: 12px; margin-top: 26px; text-align: center; }
.pa-links a {
    color: var(--pa-muted);
    text-decoration: none;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: color .15s;
}
.pa-links a:hover { color: var(--pa-primary); }
.pa-links i { font-size: 26px; }

.pa-foot { text-align: center; color: var(--pa-muted); font-size: 11px; margin-top: 34px; line-height: 1.5; }
.pa-foot a { color: var(--pa-muted); text-decoration: none; }
.pa-foot a:hover { color: var(--pa-primary); }

/* ----- Lock screen (desbloqueio) ----- */
.pa-lock-avatar {
    width: 84px;
    height: 84px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}
.pa-lock-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pa-lock-nome { text-align: center; font-weight: 600; margin: 0 0 18px; color: var(--pa-ink); }
.blocoLocked .naoSouEu { display: block; margin: -6px 0 18px; }

/* ----- Responsivo: mobile E tablet empilhados (só o form; banner é DESKTOP-only ≥992px) ----- */
@media (max-width: 991.98px) {
    .pa-wrap { flex-direction: column; }
    /* O banner da empresa é um cartaz vertical e não cabe bem numa faixa mobile,
       então some no mobile: fica só o form, centralizado e sem espaço em branco. */
    .pa-brand { display: none; }
    .pa-panel { flex: 1 1 auto; padding: 32px 20px; }
    .pa-sys-logo { margin-top: 0; max-width: 200px; }
    .pa-card h2 { margin-bottom: 18px; }
    /* No mobile, se a empresa tem logo, ela entra no lugar da logo do Pincel */
    .pa-card.tem-logo-empresa .pa-sys-logo { display: none; }
    .pa-card.tem-logo-empresa .pa-emp-logo-mobile {
        display: block;
        margin: 0 auto 22px;
        max-width: 220px;
        max-height: 110px;
        width: auto;
        object-fit: contain;
    }
}

/* ----- Banners no mobile/tablet: faixa "Novidades" no topo do form + Stories ----- */
/* Só existe abaixo de 992px; no desktop os banners ficam na coluna .pa-brand. */
.pa-novidades { display: none !important; }
@media (max-width: 991.98px) {
    .pa-novidades.tem-banner {
        display: flex !important;
        align-items: center;
        gap: 12px;
        width: 100%;
        margin: 0 0 20px;
        padding: 10px 12px;
        border: 1px solid var(--pa-border);
        border-radius: 14px;
        background: #fff;
        color: var(--pa-ink);
        font: inherit;
        text-align: left;
        cursor: pointer;
    }
    .pa-novidades.tem-banner:active { transform: scale(.99); }
    .pa-novidades-thumbs { display: flex; flex: 0 0 auto; }
    .pa-novidades-thumbs img {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #fff;
        box-shadow: 0 0 0 2px var(--pa-primary);
        margin-left: -10px;
        background: var(--pa-border);
    }
    .pa-novidades-thumbs img:first-child { margin-left: 0; }
    .pa-novidades-txt { flex: 1 1 auto; min-width: 0; }
    .pa-novidades-txt b { display: block; font-size: 13px; }
    .pa-novidades-txt small { color: var(--pa-muted); font-size: 12px; }
    .pa-novidades .fa-chevron-right { color: var(--pa-muted); font-size: 12px; }
}
[data-theme-color=dark] .pa-novidades.tem-banner { background: #232f3b; }
[data-theme-color=dark] .pa-novidades-thumbs img { border-color: #232f3b; }

/* Stories: banners em tela cheia, barras de progresso, toque nas laterais navega */
.pa-stories {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #000;
    display: none;
    flex-direction: column;
}
.pa-stories.aberto { display: flex; }
body.pa-stories-aberto { overflow: hidden; }
.pa-stories-barras { display: flex; gap: 4px; padding: 12px 12px 8px; }
.pa-stories-barras span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.pa-stories-barras span i { display: block; height: 100%; width: 0; background: #fff; }
.pa-stories-topo { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 6px; color: #fff; font-size: 13px; opacity: .9; }
.pa-stories-fechar { background: none; border: 0; color: #fff; font-size: 22px; width: 40px; height: 40px; cursor: pointer; }
.pa-stories-midia { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
.pa-stories-midia img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.pa-stories-lado { position: absolute; top: 0; bottom: 0; width: 40%; cursor: pointer; }
.pa-stories-ant { left: 0; }
.pa-stories-prox { right: 0; }
.pa-stories-link {
    margin: 14px;
    padding: 13px;
    border-radius: 12px;
    background: #fff;
    color: #111;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

/* ----- Tema dark (opcional): escurece só o card da direita, mantém a marca ----- */
[data-theme-color=dark] body.auth-page,
body.auth-page[data-theme-color=dark] {
    --pa-ink: #e6e9ee;
    --pa-muted: #9aa5b1;
    --pa-border: #3a4652;
    --pa-bg: #1b2530;
}
[data-theme-color=dark] .pa-field input,
[data-theme-color=dark] .pa-card {
    background: #232f3b;
    color: var(--pa-ink);
}
[data-theme-color=dark] .pa-card h2,
[data-theme-color=dark] .pa-field label { color: var(--pa-ink); }

/* Domínio de produto (pincelpay/pincelcrm/pincelplay.*, includes/marca_login.php): coluna com a cor do produto
   atrás dos banners (as peças do Instagram) e logo do produto no form. */
.marca-produto .pa-brand { background: var(--pa-marca-cor, #04281E); }
.marca-produto .pa-sys-logo { max-width: 300px; width: 88%; margin-bottom: 18px; }
.marca-produto .pa-card h2 { font-size: 16px; font-weight: 600; color: var(--pa-muted); margin-bottom: 20px; }

/* Login em duas etapas (2FA) — blocos .bloco2faCadastro / .bloco2faCodigo (index.js). Usa as variáveis do tema,
   então já acompanha o dark. */
.pa-field input.pa-2fa-codigo { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 8px; }
.pa-2fa-acoes { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pa-2fa-acoes .reenviar2fa.desabilitado { opacity: .5; pointer-events: none; }
.pa-2fa-destino strong { color: var(--pa-text, inherit); }
/* Enviando/validando (login, desbloqueio, 2FA): cursor de espera em vez do "bloqueado" do [disabled]. */
.pa-btn.carregando, .pa-btn.carregando[disabled] { cursor: progress; opacity: .85; }
