:root {
    --azul: #1f6feb;
    --azul-escuro: #14467c;
    --bg: #f4f6fb;
    --texto: #1f2937;
    --borda: #d8dee9;
    --erro-bg: #fde8e8;
    --erro: #c0392b;
    --info-bg: #e8f0fe;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--texto);
    padding: 24px 16px;
    line-height: 1.5;
}

.card {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(20, 40, 80, .08);
    padding: 28px 24px;
}
.card.largo { max-width: 1000px; }
.card.centro { text-align: center; }

.cabecalho { text-align: center; margin-bottom: 20px; }
.cabecalho h1 { margin: 0 0 6px; font-size: 1.5rem; }
.cabecalho p { margin: 0; color: #5b6677; }

h1 { color: var(--azul-escuro); }

form { display: flex; flex-direction: column; gap: 16px; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: .95rem;
}

input[type=text],
input[type=number],
input[type=password],
input[type=file],
textarea {
    font: inherit;
    padding: 11px 12px;
    border: 1px solid var(--borda);
    border-radius: 9px;
    background: #fff;
    width: 100%;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .15);
}

textarea { resize: vertical; }

fieldset.tipo {
    border: 1px solid var(--borda);
    border-radius: 9px;
    padding: 12px 14px;
}
fieldset.tipo legend { font-weight: 600; padding: 0 6px; }
label.radio {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin: 6px 0;
}
label.radio input { width: auto; }

button {
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--azul);
    border: none;
    border-radius: 9px;
    padding: 13px;
    cursor: pointer;
}
button:hover { background: var(--azul-escuro); }

.alerta { padding: 11px 14px; border-radius: 9px; font-size: .92rem; }
.alerta.erro { background: var(--erro-bg); color: var(--erro); }
.alerta.info { background: var(--info-bg); color: var(--azul-escuro); }

.botao-link {
    display: inline-block;
    margin-top: 18px;
    padding: 11px 18px;
    background: var(--azul);
    color: #fff;
    text-decoration: none;
    border-radius: 9px;
    font-weight: 700;
}
.botao-link.secundario { background: #6b7280; }

/* Fundo festivo no painel admin — tema laranja, sem cartão branco */
body.admin-bg {
    background: #f37021 url('fundo.webp') center center / cover no-repeat fixed;
    min-height: 100vh;
    color: #fff;
}
body.admin-bg .card {
    background: transparent;
    box-shadow: none;
    padding: 16px 8px;
}
body.admin-bg h1 { color: #fff; }

/* Cartões de resumo no tema festivo */
body.admin-bg .resumo div {
    background: rgba(0, 0, 0, .18);
    color: rgba(255, 255, 255, .9);
}
body.admin-bg .resumo span { color: #ffd34e; }

/* Tabela no tema festivo */
body.admin-bg table { color: #fff; }
body.admin-bg th {
    background: rgba(0, 0, 0, .25);
    color: #fff;
}
body.admin-bg td { border-bottom-color: rgba(255, 255, 255, .25); }
body.admin-bg tr:nth-child(even) td { background: rgba(255, 255, 255, .06); }
body.admin-bg td.vazio { color: rgba(255, 255, 255, .8); }
body.admin-bg a { color: #ffd34e; }

.btn-excluir {
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-excluir:hover { background: #a93226; }

.btn-pago {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-pago.sim { background: #2ecc71; color: #fff; }
.btn-pago.nao { background: rgba(255,255,255,.85); color: #14467c; }
.btn-pago:hover { filter: brightness(1.05); }

.btn-anexar {
    background: var(--azul, #1f6feb);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-anexar:disabled { opacity: .5; cursor: default; }
body.admin-bg .btn-anexar { background: #ffd34e; color: #14467c; }

/* Form de anexar comprovante no painel */
.form-anexar { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn-arquivo {
    display: inline-block;
    background: rgba(255, 255, 255, .9);
    color: #14467c;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-arquivo:hover { filter: brightness(.97); }

/* Alinhamento vertical das células do painel */
body.admin-bg td { vertical-align: middle; }

/* Centraliza as colunas de ação (Pago, Comprovante, Ação) */
body.admin-bg th:nth-child(n+7),
body.admin-bg td:nth-child(n+7) { text-align: center; }
body.admin-bg .form-anexar { justify-content: center; }

/* "Ver" no mesmo formato dos outros botões (alinha certinho) */
.btn-ver {
    display: inline-block;
    background: #ffffff;
    color: #14467c !important;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}
.btn-ver:hover { filter: brightness(.97); }

/* Painel */
.cabecalho-acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cabecalho-painel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.resumo {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.resumo div {
    flex: 1;
    min-width: 130px;
    background: var(--info-bg);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    font-size: .9rem;
    color: #5b6677;
}
.resumo span {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--azul-escuro);
}

.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--borda);
    vertical-align: middle;
}
th { background: #f0f3fa; color: var(--azul-escuro); }
td.vazio { text-align: center; color: #8a93a3; padding: 24px; }

/* ============================================================
   Formulário multi-etapas (estilo Typeform) — body.tela-cheia
   ============================================================ */
body.tela-cheia {
    padding: 0;
    min-height: 100vh;
    overflow: hidden;
    background: #f37021 url('fundo.webp') center center / cover no-repeat fixed;
    color: #fff;
}

/* Fundo especial (com o padre) só na tela de seleção de comidas.
   Mesma posição/escala do fundo geral para o xadrez e as bandeirinhas
   ficarem alinhados (sem "pulo" na troca de página). */
.passo[data-campo="itens"] {
    background: #f37021 url('fundo-comidas.webp') center center / cover no-repeat fixed;
}

/* Passo do vídeo em tela cheia */
.passo--video { padding: 0; }
.video-fundo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    z-index: 0;
}
.video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 40px;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 55%, rgba(0,0,0,.5) 100%);
}
.video-overlay .btn-grande { align-self: flex-end; font-size: 1.25rem; padding: 16px 40px; }

/* Mobile: vídeo pequeno e contido, sobre o fundo festivo, botão embaixo */
@media (max-width: 600px) {
    .passo--video {
        padding: 24px;
        flex-direction: column;
        justify-content: center;
        gap: 26px;
    }
    .video-fundo {
        position: static;
        inset: auto;
        width: 100%;
        max-width: 460px;
        height: auto;
        max-height: 55vh;
        object-fit: contain;
        border-radius: 14px;
        box-shadow: 0 8px 30px rgba(0,0,0,.3);
    }
    .video-overlay {
        position: static;
        inset: auto;
        background: none;
        padding: 0;
        align-items: center;
    }
    .video-overlay .btn-grande { align-self: center; }
}

/* Tela de boas-vindas: vídeo + convite (permite rolar se for alto) */
.passo-conteudo--largo {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    text-align: center;
}
.passo--intro {
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    overflow-y: auto;
    padding-top: 40px;
    padding-bottom: 40px;
}
.passo--intro.ativo { display: flex; }
.convite-video {
    width: 100%;
    border-radius: 6px;
    background: #000;
    display: block;
}
.convite-titulo {
    font-size: 1.7rem;
    margin: 22px 0 14px;
    text-align: center;
}
.convite-texto {
    color: #fff;
    line-height: 1.55;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.convite-texto p { max-width: 1120px; margin: 0 0 10px; }
/* nowrap só em telas grandes; no celular o texto quebra normalmente */
@media (min-width: 800px) {
    .convite-texto .nao-quebrar { white-space: nowrap; }
}
.convite-info { margin-top: 14px !important; }
.passo-conteudo--largo .btn-grande { align-self: center; margin-top: 8px; }

/* Barra de progresso no topo */
.progresso {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: rgba(255, 255, 255, .2);
    z-index: 20;
}
.progresso-barra {
    height: 100%;
    width: 0;
    background: #ffd34e;
    transition: width .4s ease;
}

/* O form ocupa a tela toda; cada passo é uma "página" */
.tela-cheia #formMulti {
    display: block;
    position: relative;
    height: 100vh;
    margin: 0;
    gap: 0;
}

.passo {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.passo.ativo { display: flex; z-index: 2; }

/* Crossfade: tela que está saindo continua visível e some suavemente */
.passo.saindo {
    display: flex;
    z-index: 1;
    animation: saiTela .4s ease forwards;
    pointer-events: none;
}
@keyframes saiTela { from { opacity: 1; } to { opacity: 0; } }

.passo-conteudo {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.passo h1 {
    color: #fff;
    font-size: 2rem;
    line-height: 1.2;
    margin: 0;
}
.passo .sub { color: rgba(255, 255, 255, .85); margin: 0; font-size: 1.2rem; }
.passo .num { color: #ffd34e; font-weight: 700; font-size: .95rem; }

.pergunta {
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    display: block;
}

/* Campos sobre fundo colorido */
.tela-cheia input[type=text],
.tela-cheia input[type=number],
.tela-cheia input[type=password],
.tela-cheia textarea {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, .6);
    border-radius: 0;
    color: #fff;
    font-size: 1.5rem;
    padding: 8px 2px;
    width: 100%;
}
.tela-cheia input::placeholder,
.tela-cheia textarea::placeholder { color: rgba(255, 255, 255, .6); font-weight: 400; }
.tela-cheia input:focus,
.tela-cheia textarea:focus {
    outline: none;
    border-bottom-color: #fff;
    box-shadow: none;
    background: transparent;
}
/* Remove o fundo branco do preenchimento automático do navegador */
.tela-cheia input:-webkit-autofill,
.tela-cheia input:-webkit-autofill:hover,
.tela-cheia input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    transition: background-color 9999s ease-in-out 0s;
}

/* Opções (radio em cartão) */
.opcoes { display: flex; flex-direction: column; gap: 12px; }
.opcao {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, .1);
    border: 2px solid rgba(255, 255, 255, .3);
    border-radius: 12px;
    padding: 16px 18px;
    cursor: pointer;
    transition: all .15s ease;
}
.opcao:hover { background: rgba(255, 255, 255, .18); }
.opcao input { accent-color: #fff; width: 20px; height: 20px; margin-right: 14px; }
.opcao:has(input:checked) {
    border-color: #ffd34e;
    background: rgba(255, 211, 78, .2);
}
.opcao-corpo { display: flex; justify-content: space-between; width: 100%; align-items: center; }
.opcao-corpo strong { font-size: 1.15rem; }
.opcao-corpo .valor { font-size: 1.5rem; font-weight: 800; color: #fff; }

/* Múltipla escolha com letras (A, B, C...) */
.passo-conteudo--opcoes { max-width: 820px; }
/* Comidas em 2 colunas de 5 (preenche coluna por coluna) */
.opcoes-letras.opcoes-letras--grade {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(5, auto);
    grid-auto-flow: column;
    gap: 8px 16px;
}
@media (max-width: 600px) {
    .opcoes-letras.opcoes-letras--grade {
        display: flex;
        flex-direction: column;
    }
}
.sub-dica { color: rgba(255, 255, 255, .85); margin: 4px 0 6px; font-size: 1.15rem; }
.opcoes-letras { display: flex; flex-direction: column; gap: 8px; }
.opcao-letra {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 12px;
    border: 1.5px solid rgba(255, 255, 255, .55);
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.opcao-letra:hover { background: rgba(255, 255, 255, .12); }
.opcao-letra input { position: absolute; opacity: 0; pointer-events: none; }
.opcao-letra .letra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border: 1.5px solid rgba(255, 255, 255, .8);
    border-radius: 5px;
    font-size: .8rem;
    font-weight: 700;
    flex: 0 0 auto;
}
.opcao-letra .opcao-texto { font-size: 1.05rem; }
.opcao-letra:has(input:checked) {
    background: #fff;
    border-color: #fff;
    color: #f37021;
}
.opcao-letra:has(input:checked) .letra {
    background: #f37021;
    border-color: #f37021;
    color: #fff;
}
/* Lista curta (ex.: Sim/Não) — botões do tamanho do conteúdo */
.opcoes-letras--curto { align-items: flex-start; }
.opcoes-letras--curto .opcao-letra { min-width: 150px; }

.opcao-obs { font-weight: 400; opacity: .85; font-size: .8rem; }
.pix-nome { font-weight: 400; opacity: .9; }

.opcao-letra.desabilitada {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}
.campo-outra {
    margin-top: 4px;
    font-size: 1.05rem !important;
}
.escondido { display: none !important; }

/* Botões */
.btn-grande {
    align-self: flex-start;
    background: #fff;
    color: #f37021;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    padding: 12px 26px;
    cursor: pointer;
    transition: transform .1s ease, filter .15s ease;
}
.btn-grande:hover { filter: brightness(1.05); }
.btn-grande:active { transform: scale(.97); }
.btn-grande.enviar { background: #2ecc71; color: #fff; }

.acoes { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.acoes .dica { font-size: .85rem; color: rgba(255, 255, 255, .7); }

/* Dropzone do comprovante */
.dropzone {
    display: block;
    border: 2px dashed rgba(255, 255, 255, .5);
    border-radius: 12px;
    padding: 32px 18px;
    text-align: center;
    cursor: pointer;
    transition: all .15s ease;
    font-size: 1.05rem;
}
.dropzone:hover { background: rgba(255, 255, 255, .1); }
.dropzone.preenchido { border-color: #2ecc71; background: rgba(46, 204, 113, .15); }

/* Rodapé de navegação */
.rodape-nav {
    position: fixed;
    bottom: 18px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 20;
}
.btn-nav {
    background: rgba(0, 0, 0, .25);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}
.btn-nav:disabled { opacity: .4; cursor: default; }
.contador { font-size: .85rem; color: rgba(255, 255, 255, .8); }

/* Erros */
.erro-campo {
    background: rgba(192, 57, 43, .9);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: .95rem;
}
.alerta.flutuante {
    position: fixed;
    top: 18px; left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    transition: opacity .5s ease;
}
.alerta.flutuante.some { opacity: 0; }

/* Animações */
@keyframes entraBaixo { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes entraCima  { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
.passo.entra-baixo .passo-conteudo { animation: entraBaixo .55s cubic-bezier(.22, .61, .36, 1) both; }
.passo.entra-cima  .passo-conteudo { animation: entraCima .55s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes treme { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
.passo.treme .passo-conteudo { animation: treme .4s ease; }

@media (max-width: 480px) {
    .passo h1 { font-size: 1.6rem; }
    .pergunta { font-size: 1.5rem; }
    .passo .sub { font-size: 1.05rem; }
    .convite-titulo { font-size: 1.4rem; }
    .convite-texto { font-size: .95rem; }
    .passo { padding: 18px; }
    .tela-cheia input[type=text],
    .tela-cheia input[type=number],
    .tela-cheia textarea { font-size: 1.2rem; }
    /* Sim/Não ocupam a largura no celular */
    .opcoes-letras--curto .opcao-letra { min-width: 0; width: 100%; }
    /* Resumo do admin empilha */
    .resumo div { min-width: 0; flex-basis: 100%; }
    .cabecalho-painel { flex-wrap: wrap; gap: 10px; }
}
