/* Tela de login do painel (templates/admin_login.html).
   Sem recurso externo (CSP default-src 'self'): fontes do sistema, ícones e paisagem em SVG inline.
   Tema: escuro por padrão; html.light = claro. Mesma chave "theme" do painel no localStorage; sem
   escolha gravada, segue o sistema (o <script> do <head> decide antes de desenhar). */

:root {
    --fundo: #0b0e0d;
    --cartao: #131817;
    --cartao-borda: #242c2a;
    --texto: #f3f6f5;
    --texto-2: #c9d1ce;
    --texto-3: #98a39f;
    --campo: #0d1110;
    --campo-borda: #2f3936;
    --campo-borda-hover: #46524e;
    --placeholder: #77837f;
    --hover: rgba(255,255,255,0.06);
    --acento: #ffe500;
    --acento-hover: #fff033;
    --acento-texto: #111;
    --check: #ffe500;
    --foco: #ffe500;
    --erro-fundo: rgba(239,68,68,0.12);
    --erro-borda: rgba(239,68,68,0.45);
    --erro-titulo: #fca5a5;
    --erro-texto: #fde2e2;
    --alerta-fundo: rgba(250,204,21,0.10);
    --alerta-borda: rgba(250,204,21,0.45);
    --alerta-titulo: #fde047;
    --alerta-texto: #fef3c7;
    --sombra: 0 24px 60px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3);
    /* painel da marca: lago (azul) -> mata (verde), com o sol amarelo do painel */
    --marca-1: #0b3550;
    --marca-2: #0d4537;
    --marca-3: #12331d;
    --marca-brilho: rgba(255,229,0,0.14);
    --sol: #ffe500;
    --morro-longe: rgba(0,0,0,0.22);
    --morro-perto: rgba(0,0,0,0.34);
    --lago: #0a2c43;
    --onda: rgba(255,255,255,0.22);
    --palmeira: #05140e;
    color-scheme: dark;
}
html.light {
    --fundo: #eef3f1;
    --cartao: #ffffff;
    --cartao-borda: #dde5e2;
    --texto: #13201c;
    --texto-2: #2f403b;
    --texto-3: #56665f;
    --campo: #ffffff;
    --campo-borda: #c3cfca;
    --campo-borda-hover: #93a69f;
    --placeholder: #7c8a85;
    --hover: rgba(0,0,0,0.05);
    --acento: #facc15;
    --acento-hover: #eab308;
    --acento-texto: #161616;
    --check: #1d6a99;
    --foco: #1d4ed8;
    --erro-fundo: #fef2f2;
    --erro-borda: #f5a3a3;
    --erro-titulo: #991b1b;
    --erro-texto: #6b1a1a;
    --alerta-fundo: #fffbeb;
    --alerta-borda: #f3cf5a;
    --alerta-titulo: #854d0e;
    --alerta-texto: #5c3a06;
    --sombra: 0 20px 50px rgba(15,40,30,0.12), 0 2px 6px rgba(15,40,30,0.08);
    --marca-1: #1d6a99;
    --marca-2: #237a5e;
    --marca-3: #2e7a3c;
    --marca-brilho: rgba(255,229,0,0.22);
    --morro-longe: rgba(0,0,0,0.12);
    --morro-perto: rgba(0,0,0,0.2);
    --lago: #1b5f8c;
    --onda: rgba(255,255,255,0.4);
    --palmeira: #123a22;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--fundo); color: var(--texto);
    font: 400 1rem/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul { margin: 0; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }

.pagina { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- painel da marca (no celular: faixa no topo) ---------- */
.marca {
    position: relative; overflow: hidden; isolation: isolate; color: #fff;
    background:
        radial-gradient(120% 70% at 80% 100%, var(--marca-brilho) 0%, transparent 60%),
        linear-gradient(160deg, var(--marca-1) 0%, var(--marca-2) 55%, var(--marca-3) 100%);
    padding: 1.25rem 16px 128px;
}
.marca-conteudo { position: relative; z-index: 1; max-width: 520px; }
/* SeuWIFI em vetor, sem fundo: o amarelo da marca sobre a faixa (escura no tema escuro, azul/verde no claro) */
.marca-sw { display: block; width: 96px; }
.marca-sw svg { display: block; width: 100%; height: auto; overflow: visible; }
.marca-sw .sw-seu, .marca-sw .sw-arcos { fill: #FBFA02; }
html.light .marca-sw svg { filter: drop-shadow(0 1px 1.5px rgba(0,0,0,0.3)); }
.marca h1 { margin-top: 0.75rem; font-size: 1.6rem; line-height: 1.15; font-weight: 750; letter-spacing: -0.01em; }
/* Licenciado para: logos do hotel e da Cabana em pastilhas claras */
.licenciado { margin-top: 0.7rem; }
.lic-rot {
    font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 650; color: rgba(255,255,255,0.85);
}
.lic-lista { list-style: none; padding: 0; margin: 0.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.lic-pill {
    display: inline-flex; align-items: center; gap: 0.45rem; height: 32px; background: #fff; border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.22); color: #2b2420; font-size: 0.8rem; font-weight: 650; white-space: nowrap;
}
.lic-hotel { padding: 4px 12px; }
.lic-hotel img { display: block; height: 24px; width: auto; }
.lic-cabana { padding: 2px 12px 2px 2px; }
.lic-cabana img { display: block; width: 28px; height: 28px; border-radius: 50%; }
.marca-lista { display: none; list-style: none; padding: 0; }
.marca-lista li { display: flex; align-items: center; gap: 0.75rem; font-size: 1rem; color: rgba(255,255,255,0.95); }
.marca-lista .ic {
    width: 2.3rem; height: 2.3rem; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px;
    background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
}
.marca-lista svg { width: 18px; height: 18px; }

.paisagem { position: absolute; left: 0; bottom: 0; width: 100%; height: 120px; z-index: 0; display: block; }
.paisagem .sol { fill: var(--sol); opacity: 0.92; }
.paisagem .morro-longe { fill: var(--morro-longe); }
.paisagem .morro-perto { fill: var(--morro-perto); }
.paisagem .lago { fill: var(--lago); }
.paisagem .ondas { fill: none; stroke: var(--onda); stroke-width: 3; stroke-linecap: round; }
.paisagem .palmeira { fill: var(--palmeira); }
.paisagem .tronco { fill: none; stroke: var(--palmeira); stroke-width: 9; stroke-linecap: round; }

/* ---------- lado do formulário ---------- */
.lado { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 16px; }
.lado-centro {
    width: 100%; max-width: 420px; flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
    position: relative; z-index: 1; animation: surgir 0.35s ease-out both;
}
.cartao {
    position: relative; margin-top: -2.5rem; background: var(--cartao); border: 1px solid var(--cartao-borda);
    border-radius: 18px; padding: 1.6rem 1.25rem 1.35rem; box-shadow: var(--sombra);
}
/* filete com as cores do logo (palmeira, lago e tronco) */
.cartao::before {
    content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 3px; border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, #3a944a 0%, #2a8ac4 55%, #eba24c 100%);
}
.cartao h2 { font-size: 1.4rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; color: var(--texto); }
.cartao-sub { margin-top: 0.35rem; font-size: 0.92rem; color: var(--texto-3); }

.aviso {
    display: flex; gap: 0.7rem; align-items: flex-start; margin-top: 1.1rem; padding: 0.8rem 0.95rem;
    border-radius: 12px; border: 1px solid var(--erro-borda); background: var(--erro-fundo); color: var(--erro-texto);
    font-size: 0.88rem; line-height: 1.45;
}
.aviso svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0.1rem; color: var(--erro-titulo); }
.aviso strong { display: block; margin-bottom: 0.15rem; font-size: 0.94rem; font-weight: 650; color: var(--erro-titulo); }
.aviso .ic-relogio { display: none; }
.aviso-bloqueio { border-color: var(--alerta-borda); background: var(--alerta-fundo); color: var(--alerta-texto); }
.aviso-bloqueio svg, .aviso-bloqueio strong { color: var(--alerta-titulo); }
.aviso-bloqueio .ic-erro { display: none; }
.aviso-bloqueio .ic-relogio { display: block; }
.aviso-js { margin: 1rem 0 0; }

form { margin-top: 1.3rem; }
.campo { margin-bottom: 1.05rem; }
.campo label { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; font-weight: 600; color: var(--texto-2); }
.entrada { position: relative; }
.entrada > svg {
    position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
    color: var(--texto-3); pointer-events: none;
}
.entrada input {
    width: 100%; height: 3rem; padding: 0 1rem 0 2.75rem; background: var(--campo); color: var(--texto);
    border: 1px solid var(--campo-borda); border-radius: 12px; font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.entrada input::placeholder { color: var(--placeholder); opacity: 1; }
.entrada input:hover { border-color: var(--campo-borda-hover); }
.entrada input:focus { outline: 2px solid var(--foco); outline-offset: 1px; border-color: var(--foco); }
.entrada input[aria-invalid="true"] { border-color: var(--erro-borda); }
.entrada-senha input { padding-right: 3.4rem; }
/* o ícone do e-mail/senha some atrás do preenchimento automático do navegador: sem problema */
.ver-senha {
    position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%); width: 2.6rem; height: 2.6rem;
    display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: none;
    color: var(--texto-3); cursor: pointer;
}
.ver-senha:hover { color: var(--texto); background: var(--hover); }
.ver-senha svg { width: 20px; height: 20px; }
.ver-senha .olho-fechado { display: none; }
.ver-senha[aria-pressed="true"] .olho { display: none; }
.ver-senha[aria-pressed="true"] .olho-fechado { display: block; }

.caps { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.45rem; font-size: 0.84rem; color: var(--alerta-titulo); }
.caps svg { width: 16px; height: 16px; flex-shrink: 0; }

.lembrar {
    display: flex; align-items: center; gap: 0.6rem; min-height: 2.25rem; margin: 0.1rem 0 1.1rem;
    font-size: 0.9rem; color: var(--texto-2); cursor: pointer; width: fit-content;
}
.lembrar input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--check); cursor: pointer; }

.btn-entrar {
    width: 100%; height: 3.15rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    border: 0; border-radius: 12px; background: var(--acento); color: var(--acento-texto);
    font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.btn-entrar:hover:not(:disabled) { background: var(--acento-hover); }
.btn-entrar:active:not(:disabled) { transform: translateY(1px); }
.btn-entrar:focus-visible { outline-offset: 3px; }
.btn-entrar:disabled { cursor: not-allowed; opacity: 0.72; }
.btn-entrar.carregando:disabled { cursor: progress; opacity: 0.9; }
.girando {
    display: none; width: 1.1rem; height: 1.1rem; border: 2.5px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: girar 0.7s linear infinite;
}
.carregando .girando { display: inline-block; }

.ajuda { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--cartao-borda); font-size: 0.88rem; color: var(--texto-3); }
.ajuda summary {
    display: flex; align-items: center; gap: 0.4rem; width: fit-content; min-height: 2rem; border-radius: 6px;
    list-style: none; cursor: pointer; font-weight: 600; color: var(--texto-2);
}
.ajuda summary::-webkit-details-marker { display: none; }
.ajuda summary svg { width: 16px; height: 16px; transition: transform 0.15s; }
.ajuda[open] summary svg { transform: rotate(90deg); }
.ajuda ul { display: grid; gap: 0.5rem; margin-top: 0.6rem; padding-left: 1.1rem; line-height: 1.45; }
.ajuda strong { color: var(--texto-2); font-weight: 600; }

.rodape {
    width: 100%; max-width: 420px; display: grid; gap: 0.55rem; justify-items: center; text-align: center;
    padding: 1.5rem 0 calc(1.25rem + env(safe-area-inset-bottom)); font-size: 0.8rem; color: var(--texto-3);
}
.rodape-marca { font-weight: 600; color: var(--texto-2); }
.rodape-linha { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem 0.75rem; }
.selo-teste {
    display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 600;
    border: 1px solid var(--alerta-borda); background: var(--alerta-fundo); color: var(--alerta-titulo);
}
.tema {
    display: inline-flex; align-items: center; gap: 0.4rem; height: 2.25rem; padding: 0 0.85rem; border-radius: 999px;
    border: 1px solid var(--cartao-borda); background: var(--cartao); color: var(--texto-2); font-size: 0.82rem; cursor: pointer;
}
.tema:hover { color: var(--texto); border-color: var(--campo-borda-hover); }
.tema svg { width: 16px; height: 16px; }
html.light .tema .so-escuro, html:not(.light) .tema .so-claro { display: none; }

/* ---------- computador: duas colunas ---------- */
@media (min-width: 900px) {
    .pagina { flex-direction: row; }
    .marca {
        flex: 0 0 46%; max-width: 760px; min-height: 100vh; min-height: 100dvh;
        padding: clamp(2rem, 6vh, 3.5rem) clamp(2rem, 4vw, 4rem) 0;
    }
    .marca-sw { width: clamp(150px, 13vw, 200px); }
    .marca h1 { margin-top: clamp(1.25rem, 4vh, 2.25rem); font-size: clamp(2rem, 3vw, 2.7rem); }
    .licenciado { margin-top: 1rem; }
    .lic-rot { font-size: 0.75rem; }
    .lic-lista { gap: 0.6rem; margin-top: 0.55rem; }
    .lic-pill { height: 42px; font-size: 0.92rem; }
    .lic-hotel { padding: 5px 16px; }
    .lic-hotel img { height: 32px; }
    .lic-cabana { padding: 3px 16px 3px 3px; gap: 0.6rem; }
    .lic-cabana img { width: 36px; height: 36px; }
    .marca-lista { display: grid; gap: 0.85rem; margin-top: clamp(1.25rem, 4vh, 2.25rem); }
    .paisagem { height: clamp(150px, 34vh, 320px); }
    .lado { padding: 2rem clamp(1.5rem, 4vw, 4rem) 0; }
    .lado-centro { justify-content: center; }
    .cartao { margin-top: 0; padding: 2.25rem 2rem 1.6rem; }
}
/* tela baixa (notebook com barras): a lista sai para não encostar na paisagem */
@media (min-width: 900px) and (max-height: 640px) {
    .marca-lista { display: none; }
}
@media (max-width: 360px) {
    .marca-sw { width: 84px; }
    .lic-pill { height: 28px; font-size: 0.74rem; }
    .lic-hotel img { height: 20px; }
    .lic-cabana img { width: 24px; height: 24px; }
    .marca h1 { font-size: 1.45rem; }
    .cartao { padding: 1.4rem 1rem 1.2rem; }
}

/* ---------- animações (respeita "reduzir movimento") ---------- */
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes surgir { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tremer {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}
.cartao.tremer { animation: tremer 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@media (prefers-reduced-motion: reduce) {
    .lado-centro, .cartao.tremer { animation: none; }
    .girando { animation-duration: 1.6s; }
    .entrada input, .btn-entrar, .ajuda summary svg { transition: none; }
}
@media (forced-colors: active) {
    .btn-entrar { border: 2px solid ButtonText; }
    .lic-pill, .marca-sw { forced-color-adjust: none; }
}

/* Crédito: a marca SeuWIFI já está em destaque no topo; aqui só o link do site */
.dev-por {
    display: inline-flex; align-items: center; color: var(--texto-3); font-size: 0.78rem; text-decoration: none;
    border-radius: 8px; padding: 0.3rem 0.6rem; transition: color 0.15s, background 0.15s;
}
.dev-por:hover, .dev-por:focus-visible { color: var(--texto-2); background: var(--cartao); text-decoration: underline; }
