/* acesso.css — Login da PLATAFORMA (visual coteplan aprovado em 04/08/2026)
 *
 * Desenho: dois painéis, como os SaaS modernos — à esquerda o painel ROXO
 * do coteplan (formas orgânicas + espaço para a foto real), à direita o
 * cartão de acesso de sempre. NENHUMA classe/id mudou: as abas, o trial,
 * as telas de status e todo o JavaScript continuam exatamente os mesmos —
 * isto aqui é só a pele.
 *
 * A paleta entra por VARIÁVEIS no body: tudo que usa var(--primary) na
 * página (botões, abas, focos) vira roxo sem tocar regra por regra.
 */

body {
    /* a identidade OFICIAL do coteplan (c:\projetos\coteplan\config\theme.json):
       índigo #696CFF + Poppins — o mesmo índigo do tema Sneat do CRM, então
       a plataforma inteira conversa com a marca */
    --primary: #696CFF;
    --primary-hover: #5F61E6;
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;

    background: var(--bg-light, #F9F9FF);
    display: flex;
    padding: 0; margin: 0;
    min-height: 100vh;
    overflow-x: hidden; overflow-y: auto;
}

.crm-app-wrap { display: flex; width: 100%; min-height: 100vh; }

/* ── PAINEL DA FOTO (esquerda) ─────────────────────────────────────── */
/* A FOTO ocupa o painel INTEIRO, canto a canto, sem moldura — e o índigo
   da marca entra por cima dela como um VÉU translúcido (pedido do dono,
   04/08: "como se o roxo estivesse por cima com transparência"). Logo,
   frase e formas ficam na camada de cima, em branco. */
.painel-coteplan {
    position: relative;
    flex: 1 1 52%;
    min-height: 100vh;
    overflow: hidden;
    background: url('/assets/img/coteplan-login.jpg') center 30% / cover no-repeat, #4D50D8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 52px;
    color: #fff;
}
.painel-coteplan::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(72, 75, 205, 0.86) 0%, rgba(105, 108, 255, 0.78) 45%, rgba(130, 133, 255, 0.70) 100%);
    pointer-events: none;
}
.painel-coteplan .blob { position: absolute; border-radius: 999px; pointer-events: none; }
.painel-coteplan .blob.a { width: 420px; height: 420px; left: -160px; top: -120px; background: rgba(255,255,255,.07); }
.painel-coteplan .blob.b { width: 300px; height: 300px; right: -110px; top: 22%; background: rgba(61,64,190,.5); }
.painel-coteplan .blob.c { width: 380px; height: 380px; left: -90px; bottom: -140px; background: rgba(165,167,255,.28); }
.painel-coteplan .blob.d { width: 150px; height: 150px; right: 14%; bottom: 10%; background: rgba(255,255,255,.10); }

.marca-wrap { position: relative; }
.painel-coteplan .marca {
    display: flex; align-items: center; gap: 12px;
    font-size: 30px; font-weight: 700; letter-spacing: -.01em;
}
.painel-coteplan .marca-sub {
    margin: 8px 0 0 54px; /* alinha com o texto, depois do ícone */
    font-size: 14.5px; font-weight: 500; opacity: .9;
}

/* (a foto virou o FUNDO do painel — a moldura interna morreu; o div .foto
   segue no HTML só como espaçador do flex, invisível) */
.painel-coteplan .foto { flex: 1; }

.painel-coteplan .frase { position: relative; }
.painel-coteplan .frase h2 {
    font-size: clamp(21px, 2.4vw, 29px); font-weight: 750; line-height: 1.25;
    text-wrap: balance; max-width: 18ch; margin: 0;
}
.painel-coteplan .frase p { margin: 10px 0 0; font-size: 14.5px; opacity: .85; max-width: 44ch; line-height: 1.55; }

/* ── PAINEL DO CARTÃO (direita) ────────────────────────────────────── */
.access-container {
    flex: 1 1 48%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 44px 28px;
    position: relative; z-index: 1;
    background: var(--bg-white, #fff);
}

/* o logo do formulário está ESCONDIDO (a marca vive no painel roxo — duas
   vezes é redundante, decisão do dono). Os ids logoTitle/logoSub continuam
   no HTML porque o tenant-branding escreve neles. */
.logo-area { display: none; text-align: center; margin-bottom: 18px; }
.logo-area .logo { font-size: 26px; font-weight: 700; color: #222; letter-spacing: -0.3px; }
.logo-area .logo span { color: var(--primary); }
.logo-area .logo-sub { font-size: 13.5px; color: var(--text-muted, #6B6480); margin-top: 4px; font-weight: 500; }

.access-card {
    width: 100%; max-width: 400px;
    background: var(--bg-white, #fff);
    border: 1px solid var(--border, #E6E2F0);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(36, 30, 53, 0.10);
    overflow: hidden;
}

.access-tabs { display: flex; border-bottom: 2px solid var(--border); }
.access-tab {
    flex: 1; padding: 13px 8px; text-align: center;
    font-size: 13.5px; font-weight: 700; font-family: inherit;
    color: var(--text-muted); background: none; border: none; cursor: pointer;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.access-tab:hover { color: var(--text-primary); }
.access-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; padding: 22px; }
.tab-panel.active { display: block; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.form-group label .req { color: var(--danger); }
.form-group input {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
    border-radius: 12px; font-size: 14.5px; font-family: inherit;
    outline: none; transition: border-color 0.2s, box-shadow 0.2s; background: var(--bg-white);
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.18); }
.form-group input:read-only { background: var(--bg-input); color: var(--text-muted); cursor: not-allowed; }
.form-group .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.btn-primary {
    width: 100%; padding: 13px; background: var(--primary); color: #fff;
    border: none; border-radius: 12px; font-size: 15px; font-weight: 750;
    font-family: inherit; cursor: pointer; margin-top: 2px;
    transition: filter 0.15s, transform 0.08s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-google {
    width: 100%; padding: 11px; background: var(--bg-white); color: var(--text-primary);
    border: 1.5px solid var(--border); border-radius: 12px; font-size: 14px;
    font-weight: 600; font-family: inherit; cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-google:hover { border-color: var(--primary); background: var(--bg-light); }
.btn-google:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.divider {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 0; color: var(--text-muted); font-size: 12px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.google-info {
    display: none; background: var(--success-light); border: 1px solid var(--success);
    border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
    font-size: 13px; color: #059669; text-align: center;
}
.google-info.show { display: block; }
.google-info strong { font-weight: 700; }

.form-msg {
    font-size: 13px; margin-top: 12px; display: none;
    text-align: center; padding: 10px 14px; border-radius: 10px;
}
.form-msg.show { display: block; }
.form-msg.error { background: var(--danger-light); color: var(--danger); }
.form-msg.success { background: var(--success-light); color: var(--success); }
.form-msg.warning { background: var(--warning-light); color: #92400e; }

.status-screen { display: none; text-align: center; padding: 40px 32px; }
.status-screen.show { display: block; }
.status-screen .status-icon { font-size: 56px; margin-bottom: 16px; color: var(--primary); }
.status-screen h3 { font-size: 20px; margin-bottom: 8px; }
.status-screen p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }
.status-screen .status-detail {
    background: var(--bg-light); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 18px; font-size: 13px; color: var(--text-secondary);
    margin-bottom: 20px; text-align: left;
}
.status-screen .status-detail strong { color: var(--text-primary); }

.btn-secondary {
    display: inline-block; padding: 12px 28px; background: var(--secondary);
    color: #fff; border: none; border-radius: 12px; font-size: 14px;
    font-weight: 700; font-family: inherit; cursor: pointer;
    text-decoration: none; transition: opacity 0.2s; margin: 4px;
}
.btn-secondary:hover { opacity: 0.85; }

.btn-outline {
    display: inline-block; padding: 12px 28px; background: transparent;
    color: var(--text-muted); border: 2px solid var(--border); border-radius: 12px;
    font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
    text-decoration: none; transition: border-color 0.2s, color 0.2s; margin: 4px;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.success-screen { display: none; text-align: center; padding: 40px 32px; }
.success-screen.show { display: block; }
.success-screen .success-icon { font-size: 56px; margin-bottom: 16px; }
.success-screen h3 { font-size: 20px; color: var(--success); margin-bottom: 8px; }
.success-screen p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }

.loading-screen { display: none; text-align: center; padding: 60px 32px; color: var(--text-muted); font-size: 15px; }
.loading-screen.show { display: block; }
.loading-spinner {
    width: 40px; height: 40px; border: 4px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}

/* Trial OTP input */
.otp-input { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.otp-input input {
    width: 48px; height: 56px; text-align: center; font-size: 24px; font-weight: 800;
    border: 2px solid var(--border); border-radius: 12px; font-family: inherit;
    outline: none; transition: border-color 0.2s; background: var(--bg-white);
}
.otp-input input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.15); }

.trial-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #059669, #10B981); color: #fff;
    padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase;
}

.trial-steps { display: flex; gap: 8px; margin: 16px 0; justify-content: center; }
.trial-step {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; background: var(--bg-light); color: var(--text-muted);
    border: 2px solid var(--border); transition: all 0.3s;
}
.trial-step.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.trial-step.done { background: var(--success); color: #fff; border-color: var(--success); }

.footer-mini { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-muted); }
.footer-mini a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.footer-mini a:hover { color: var(--primary); }

.link-forgot {
    background: none; border: none; color: var(--text-muted);
    font-size: 12.5px; cursor: pointer; font-family: inherit;
    text-decoration: underline; margin-top: 8px; transition: color 0.2s;
}
.link-forgot:hover { color: var(--primary); }

/* ── celular: o painel roxo vira uma faixa curta no topo ───────────── */
@media (max-width: 880px) {
    .crm-app-wrap { flex-direction: column; }
    .painel-coteplan { min-height: 0; flex: 0 0 auto; padding: 22px 20px; }
    .painel-coteplan .foto, .painel-coteplan .frase p { display: none; }
    .painel-coteplan .frase { margin-top: 14px; }
    .painel-coteplan .frase h2 { font-size: 18px; max-width: none; }
    .painel-coteplan .marca { font-size: 22px; gap: 9px; }
    .painel-coteplan .marca svg { width: 30px; height: 30px; }
    .painel-coteplan .marca-sub { margin: 5px 0 0 39px; font-size: 12.5px; }
    .access-container { padding: 28px 16px 48px; }
    .access-card { border-radius: 16px; }
    .access-tab { padding: 13px 8px; font-size: 13px; min-height: 44px; }
    .form-group input { min-height: 44px; }
    .btn-primary, .btn-google { min-height: 46px; }
    .btn-secondary, .btn-outline { padding: 12px 24px; min-height: 44px; }
}

/* ════ TEMA "SNEAT" — raios menores seguem valendo por cima ════ */
[data-theme="sneat"] .btn-primary {
    background: var(--primary);
    border-radius: 6px;
    box-shadow: 0 0.125rem 0.25rem 0 rgba(105, 108, 255, 0.4);
}
[data-theme="sneat"] .btn-primary:hover { background: var(--primary-hover); opacity: 1; filter: none; }
[data-theme="sneat"] .btn-google,
[data-theme="sneat"] .btn-outline,
[data-theme="sneat"] .btn-secondary,
[data-theme="sneat"] .form-group input,
[data-theme="sneat"] .otp-input input,
[data-theme="sneat"] .form-msg,
[data-theme="sneat"] .google-info,
[data-theme="sneat"] .status-screen .status-detail { border-radius: 6px; }
