/* N&C Planejados — Formulário público de pesquisa (glassmorphism) */

:root {
    --verde: #00c896;
    --verde-claro: #4fe3bb;
    --texto: #f4f6f6;
    --texto-suave: #9fb0ad;
    --erro: #ff8080;
    --vidro: rgba(255, 255, 255, 0.055);
    --vidro-forte: rgba(255, 255, 255, 0.085);
    --borda-vidro: rgba(255, 255, 255, 0.11);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--texto);
    line-height: 1.45;
    background: #0b0f11;
    -webkit-font-smoothing: antialiased;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 200, 150, 0.45) transparent;
}
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 200, 150, 0.55), rgba(79, 227, 187, 0.35));
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}
body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 200, 150, 0.85), rgba(79, 227, 187, 0.6));
    background-clip: content-box;
}

/* Fundo ambiente: gradiente + manchas de cor desfocadas (a "luz" atrás do vidro) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(58vw 58vw at 12% -8%, rgba(0, 200, 150, 0.20), transparent 60%),
        radial-gradient(52vw 52vw at 92% 8%, rgba(96, 150, 255, 0.14), transparent 62%),
        radial-gradient(60vw 60vw at 70% 104%, rgba(212, 160, 90, 0.14), transparent 60%),
        linear-gradient(165deg, #0e1417 0%, #0b0f11 55%, #090c0e 100%);
}

.page {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 18px 64px;
}

/* ---------- Cabeçalho ---------- */
.page-header { text-align: center; margin-bottom: 28px; }

.logo-img {
    max-height: 56px;
    max-width: 220px;
    width: auto;
    margin: 0 auto 18px;
    display: block;
}
.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 18px;
}
.logo-text span { color: var(--verde); }

.page-header h1 {
    font-size: 30px;
    line-height: 1.15;
    margin: 0 0 10px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.subtitle {
    color: var(--texto-suave);
    font-size: 15px;
    margin: 0 auto;
    max-width: 42ch;
}

.alert {
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 14px;
    margin-bottom: 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.alert-error {
    background: rgba(255, 128, 128, 0.12);
    color: var(--erro);
    border: 1px solid rgba(255, 128, 128, 0.28);
}

/* ---------- Painéis de vidro ---------- */
.group {
    position: relative;
    border: 1px solid var(--borda-vidro);
    border-radius: 20px;
    padding: 22px 20px 20px;
    margin-bottom: 18px;
    background: var(--vidro);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.group legend {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--verde);
    padding: 0 10px;
    margin-left: -4px;
}

.dica-grupo {
    font-size: 13px;
    color: var(--texto-suave);
    margin: -2px 0 16px;
    line-height: 1.45;
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field-row { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
.field-row:last-child { margin-bottom: 0; }
@media (min-width: 480px) {
    .field-row { grid-template-columns: 1fr 1fr; }
}

label {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 7px;
    color: var(--texto-suave);
}

input[type="text"], select {
    width: 100%;
    font-size: 16px; /* nunca menor: evita o zoom automático do iOS */
    padding: 13px 15px;
    min-height: 48px;
    border: 1px solid var(--borda-vidro);
    border-radius: 13px;
    background: var(--vidro-forte);
    color: var(--texto);
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
input[type="text"]::placeholder { color: rgba(159, 176, 173, 0.55); }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239fb0ad' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}
/* A lista aberta do select é desenhada pelo SO — forçar cores legíveis */
select option { background: #141a1d; color: var(--texto); }

input:focus, select:focus {
    outline: none;
    border-color: var(--verde);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.20);
}

.erro { color: var(--erro); font-size: 13px; margin: 7px 0 0; }

/* ---------- Chips (múltipla escolha) ---------- */
.campo-chips { border: none; padding: 0; margin: 0 0 16px; min-width: 0; }
.rotulo-chips {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--texto-suave);
    padding: 0;
    margin-bottom: 10px;
}
.dica-inline { font-size: 12px; opacity: 0.75; font-weight: 400; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { margin: 0; }
/* A caixa real fica escondida mas continua focável pelo teclado — o <span> é a aparência. */
.chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.chip span {
    display: inline-block;
    font-size: 14.5px;
    line-height: 1.2;
    padding: 11px 15px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--borda-vidro);
    border-radius: 999px;
    background: var(--vidro-forte);
    color: var(--texto);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
}
.chip span:hover { background: rgba(255, 255, 255, 0.12); }
.chip input:checked + span {
    background: linear-gradient(135deg, rgba(0, 200, 150, 0.9), rgba(79, 227, 187, 0.75));
    border-color: transparent;
    color: #04231a;
    font-weight: 600;
}
.chip input:focus-visible + span {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.25);
}

/* ---------- Seletor customizado ---------- */
/* O <select> real fica escondido, mas continua no formulário carregando o valor.
   Sem JS ele volta a aparecer normalmente (regra .seletor-nativo só é aplicada
   depois que o script envolve o campo). */
.seletor { position: relative; }
.seletor-nativo {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.seletor-botao {
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 16px;
    padding: 13px 40px 13px 15px;
    min-height: 48px;
    border: 1px solid var(--borda-vidro);
    border-radius: 13px;
    background: var(--vidro-forte);
    color: var(--texto);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239fb0ad' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}
.seletor-botao.vazio { color: rgba(159, 176, 173, 0.7); }
.seletor-botao:hover { background-color: rgba(255, 255, 255, 0.11); }
.seletor-botao:focus-visible {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.20);
}

.seletor-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(4, 8, 10, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: surgir 0.16s ease-out;
}
@keyframes surgir { from { opacity: 0; } to { opacity: 1; } }

.seletor-painel {
    width: 100%;
    max-width: 440px;
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--borda-vidro);
    border-radius: 20px;
    background: rgba(22, 29, 32, 0.92);
    backdrop-filter: blur(26px) saturate(150%);
    -webkit-backdrop-filter: blur(26px) saturate(150%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: aparecer 0.18s ease-out;
}
@keyframes aparecer {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .seletor-painel, .seletor-overlay { animation: none; }
}
.seletor-titulo {
    padding: 18px 20px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--texto);
    border-bottom: 1px solid var(--borda-vidro);
}
.seletor-lista { overflow-y: auto; padding: 8px; -webkit-overflow-scrolling: touch; }

/* A barra de rolagem padrão (branca/cinza do SO) destoa do painel escuro. */
.seletor-lista {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 200, 150, 0.55) transparent;
}
.seletor-lista::-webkit-scrollbar { width: 8px; }
.seletor-lista::-webkit-scrollbar-track { background: transparent; }
.seletor-lista::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 200, 150, 0.65), rgba(79, 227, 187, 0.45));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.seletor-lista::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 200, 150, 0.9), rgba(79, 227, 187, 0.7));
    background-clip: content-box;
}

.seletor-grupo {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--verde);
    padding: 14px 12px 6px;
}
.seletor-grupo:first-child { padding-top: 6px; }

.seletor-opcao {
    display: block;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 15.5px;
    color: var(--texto);
    background: none;
    border: none;
    border-radius: 11px;
    padding: 13px 14px;
    min-height: 46px;
    cursor: pointer;
}
.seletor-opcao:hover { background: rgba(255, 255, 255, 0.07); }
.seletor-opcao:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 0 0 2px rgba(0, 200, 150, 0.55);
}
.seletor-opcao.marcada { color: var(--verde-claro); font-weight: 600; }
.seletor-opcao.marcada::after { content: " ✓"; }

/* No celular o painel continua flutuando no centro, só com respiro lateral menor. */
@media (max-width: 560px) {
    .seletor-overlay { padding: 18px; }
    .seletor-painel { max-height: 74vh; }
}

/* Honeypot: fora da tela (não display:none — alguns bots ignoram esse caso) */
.hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.campo-condicional[data-oculto], .campo-outro[data-oculto] { display: none; }

/* ---------- Botão ---------- */
.btn-primary {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(135deg, var(--verde), var(--verde-claro));
    color: #04231a;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 16px 22px;
    min-height: 54px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 24px;
    box-shadow: 0 8px 26px rgba(0, 200, 150, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 32px rgba(0, 200, 150, 0.38); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 3px solid rgba(0, 200, 150, 0.5); outline-offset: 3px; }

/* ---------- Tela de agradecimento ---------- */
.page-obrigado {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.card-obrigado {
    width: 100%;
    max-width: 440px;
    text-align: center;
    padding: 40px 28px 32px;
    border: 1px solid var(--borda-vidro);
    border-radius: 24px;
    background: var(--vidro);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.card-obrigado h1 { font-size: 27px; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
.card-obrigado .subtitle { font-size: 15px; margin-bottom: 26px; }
.card-obrigado .logo-img { margin-bottom: 22px; }

/* O "salvo" é confirmação discreta: o destaque da tela é o pedido de avaliação. */
.selo-salvo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--verde-claro);
    background: rgba(0, 200, 150, 0.12);
    border: 1px solid rgba(0, 200, 150, 0.28);
    border-radius: 999px;
    padding: 7px 15px;
    margin: 0 0 22px;
}

.card-obrigado .btn-primary { margin-top: 0; }
.link-voltar {
    display: inline-block;
    margin-top: 22px;
    font-size: 14px;
    color: var(--texto-suave);
    text-decoration: none;
}
.link-voltar:hover { color: var(--texto); text-decoration: underline; }

/* Respeita quem pediu menos animação no sistema */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
