/* ==========================================================================
   Tela de login/cadastro — layout dividido do modelo AK Gestor.html.
   Página própria (login.php/cadastro.php não passam pelo index.php), por
   isso carrega separadamente. Consome os tokens de custom.css e reusa os
   componentes de ak-components.css (que são escopados em .ak-page — a
   página de auth também usa esse wrapper só pra reaproveitar o CSS).
   ========================================================================== */

html, body { height: 100%; }
body.ak-auth-body { margin: 0; background: var(--bg); font-family: var(--f-body); color: var(--ink); }

svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand {
    background: var(--surface-2); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between;
    gap: 32px; padding-block: 48px; padding-left: max(48px, env(safe-area-inset-left, 0px)); padding-right: 48px;
    position: relative; overflow: hidden;
}
.auth-brand img { width: min(300px, 70%); }
/* A logo tem o texto em azul-marinho: no escuro ela fica num cartão claro pra não sumir. */
:root[data-theme="dark"] .auth-brand img { background: #fff; padding: 14px 18px; border-radius: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-brand img { background: #fff; padding: 14px 18px; border-radius: 14px; } }
.auth-brand .claim { font-family: var(--f-display); font-size: clamp(24px, 3vw, 34px); line-height: 1.2; font-weight: 600; max-width: 16ch; }
.auth-brand .claim em { font-style: normal; color: var(--green); }
.auth-brand ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--side-ink); }
.auth-brand li { display: flex; gap: 10px; align-items: center; }
.auth-brand li svg { color: var(--green); flex: none; }
.auth-bars { position: absolute; right: -10px; bottom: -10px; display: flex; align-items: flex-end; gap: 14px; opacity: .12; }
.auth-bars span { width: 46px; background: var(--green); border-radius: 6px 6px 0 0; }

.auth-form { position: relative; display: flex; align-items: center; justify-content: center; padding-block: 40px; padding-left: 24px; padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 18px; }
.auth-card h1 { font-family: var(--f-display); font-size: 26px; font-weight: 600; margin: 0; }
.auth-card p.sub { margin: -10px 0 4px; color: var(--muted); }
.auth-card a { text-decoration: none; }
.auth-card a:hover { text-decoration: underline; }

.with-icon { position: relative; }
.with-icon svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.with-icon .ctrl { padding-right: 38px; }

.err { color: var(--red); font-size: 13px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social .btn { width: 100%; padding: 10px 14px; }
.social .btn i { font-size: 15px; width: 16px; text-align: center; }
.social .fa-google { color: #EA4335; }
.social .fa-facebook-f { color: #1877F2; }
.auth-card .btn-block { width: 100%; padding: 11px 14px; }
.auth-card .check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.auth-card .field { display: grid; gap: 6px; }
.auth-link { font-weight: 600; }
.auth-note { padding: 10px 14px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-ink); font-size: 13.5px; }
.theme-fab {
    position: absolute; top: 20px; right: max(20px, env(safe-area-inset-right, 0px)); width: 40px; height: 40px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer;
    transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.theme-fab:hover { background: var(--surface-2); color: var(--ink); }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.auth-links .muted { color: var(--muted); }
.auth-links a { cursor: pointer; font-weight: 600; text-decoration: none; }

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { padding: 28px max(20px, env(safe-area-inset-left, 0px)); }
    .auth-brand ul, .auth-bars { display: none; }
    .auth-brand img { width: 180px; }
    .auth-brand .claim { font-size: 22px; }
    /* Botão de tema no canto da página, sobre a área da marca */
    .auth { position: relative; }
    .auth-form { position: static; padding-top: 28px; }
    .theme-fab { top: 16px; right: 16px; }
}
