/* Desacelera: estilo base. Paleta em variáveis; trocar aqui muda o app inteiro. */

:root {
    --fundo: #EFE5E3;          /* areia rosada */
    --rosa: #F5C9CE;           /* destaque suave */
    --primaria: #6E7D9B;       /* azul-ardósia */
    --primaria-escura: #5A6883;
    --pervinca: #8C9CC0;       /* progresso, player */
    --card: #FFFFFF;
    --card-suave: #DEE3EA;     /* névoa */
    --card-azul: #C3D0E0;      /* azul-gelo */
    --texto: #3F4B63;          /* ardósia escurecida, contraste AA */
    --texto-suave: #6B7489;
    --borda: rgba(110, 125, 155, 0.18);
    --erro: #9B4A4A;
    --erro-fundo: #F8E3E3;
    --ok: #4E7A5E;
    --raio: 16px;
    --raio-pequeno: 12px;
    --sombra: 0 8px 24px rgba(63, 75, 99, 0.10);
    --fonte: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --largura-max: 480px;
    --altura-nav: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--fonte);
    background: var(--fundo);
    color: var(--texto);
    line-height: 1.55;
    font-size: 16px;
    min-height: 100vh;
    min-height: 100dvh;
}
body:not(.sem-nav) { padding-bottom: calc(var(--altura-nav) + env(safe-area-inset-bottom, 0px) + 16px); }

a { color: var(--primaria-escura); }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }

/* Acessibilidade */
.pular {
    position: absolute; left: -999px; top: 8px;
    background: var(--primaria); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100;
}
.pular:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--primaria); outline-offset: 2px; }
.visualmente-oculto {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Layout */
.pagina { max-width: var(--largura-max); margin: 0 auto; padding: 20px 16px 24px; }
.faixa-demo {
    background: var(--card-azul); color: var(--texto); font-size: 0.8rem;
    text-align: center; padding: 6px 12px;
}
.topo { margin-bottom: 20px; }
.topo h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.topo .sub { color: var(--texto-suave); margin-top: 4px; font-size: 0.95rem; }
.marca { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.marca img { width: 36px; height: 36px; border-radius: 10px; }
.marca strong { font-weight: 600; font-size: 1.05rem; }
.marca small { display: block; color: var(--texto-suave); font-size: 0.8rem; }

.card {
    background: var(--card); border-radius: var(--raio); padding: 18px;
    box-shadow: var(--sombra); margin-bottom: 14px;
}
.card.suave { background: var(--card-suave); box-shadow: none; }
.card.azul { background: var(--card-azul); box-shadow: none; }
.card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.card p { color: var(--texto); }
.card .rotulo { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texto-suave); margin-bottom: 6px; }

/* Botões: mínimo 44 px de altura */
.botao {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
    background: var(--primaria); color: #fff; font-weight: 600; text-decoration: none;
    cursor: pointer; width: 100%; transition: background 0.15s ease;
}
.botao:hover { background: var(--primaria-escura); }
.botao.secundario { background: var(--rosa); color: var(--texto); }
.botao.secundario:hover { background: #EFB9BF; }
.botao.fantasma { background: transparent; color: var(--primaria-escura); border: 1.5px solid var(--borda); }
.botao.fantasma:hover { background: var(--card-suave); }
.botao.pequeno { min-height: 44px; width: auto; padding: 0 16px; font-size: 0.95rem; }
.botao[disabled] { opacity: 0.6; cursor: default; }
.linha-botoes { display: flex; gap: 10px; flex-wrap: wrap; }
.linha-botoes .botao { flex: 1; }

/* Progresso */
.progresso { height: 8px; border-radius: 999px; background: var(--card-suave); overflow: hidden; }
.progresso > span { display: block; height: 100%; background: var(--pervinca); border-radius: 999px; transition: width 0.4s ease; }
.progresso-texto { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--texto-suave); margin-top: 6px; }

/* Lista de noites */
.lista-noites { list-style: none; }
.item-noite {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: var(--card); border-radius: var(--raio-pequeno); margin-bottom: 10px;
    text-decoration: none; color: inherit; box-shadow: var(--sombra);
}
.item-noite .numero {
    width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px;
    display: flex; align-items: center; justify-content: center;
    background: var(--card-suave); font-weight: 600; color: var(--primaria-escura);
}
.item-noite.concluida .numero { background: var(--rosa); }
.item-noite .info { flex: 1; min-width: 0; }
.item-noite .info strong { display: block; font-weight: 600; }
.item-noite .info small { color: var(--texto-suave); font-size: 0.85rem; }
.item-noite .seta { color: var(--pervinca); flex: 0 0 auto; }
.semana-titulo { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texto-suave); margin: 18px 0 10px; }

/* Tela da noite */
.cabecalho-noite .etapa { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--texto-suave); }
.cabecalho-noite h1 { font-size: 1.6rem; font-weight: 600; margin: 4px 0 8px; line-height: 1.2; }
.cabecalho-noite p { color: var(--texto); }
.voltar { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--texto-suave); text-decoration: none; margin-bottom: 8px; }

/* Player */
.player { background: var(--card-azul); border-radius: var(--raio); padding: 18px; margin: 18px 0; }
.player .titulo-audio { font-weight: 600; margin-bottom: 2px; }
.player .meta-audio { font-size: 0.85rem; color: var(--texto-suave); margin-bottom: 14px; }
.player .controles { display: flex; align-items: center; gap: 14px; }
.player .btn-play {
    width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--primaria); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 64px;
}
.player .btn-play svg { width: 28px; height: 28px; fill: currentColor; }
.player .btn-reiniciar {
    width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.6);
    color: var(--primaria-escura); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.player .btn-reiniciar svg { width: 22px; height: 22px; fill: currentColor; }
.player .tempo { flex: 1; }
.player input[type=range] {
    width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.player input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.7); }
.player input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primaria);
    margin-top: -7px; border: 3px solid #fff;
}
.player input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.7); }
.player input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--primaria); border: 3px solid #fff; }
.player .tempos { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--texto-suave); font-variant-numeric: tabular-nums; }
.player .estado { font-size: 0.85rem; color: var(--texto-suave); min-height: 1.3em; margin-top: 8px; }
.player .estado.erro { color: var(--erro); }
.aviso-provisorio { font-size: 0.78rem; color: var(--texto-suave); background: rgba(255,255,255,0.5); padding: 6px 10px; border-radius: 8px; margin-top: 10px; }

details.transcricao { margin-top: 10px; }
details.transcricao summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 500; color: var(--primaria-escura); }
details.transcricao p { padding: 4px 0 8px; color: var(--texto); font-size: 0.95rem; }

/* Ação e checklist */
.acao { display: flex; gap: 12px; align-items: flex-start; }
.acao .icone { width: 36px; height: 36px; border-radius: 10px; background: var(--rosa); flex: 0 0 36px; display: flex; align-items: center; justify-content: center; }
.checklist { list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.checklist input { width: 22px; height: 22px; accent-color: var(--primaria); }

/* Formulários */
.campo { margin-bottom: 14px; }
.campo label { display: block; font-weight: 500; margin-bottom: 6px; }
.campo input[type=text], .campo input[type=email], .campo input[type=password], .campo input[type=date], .campo textarea {
    width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--raio-pequeno);
    border: 1.5px solid var(--borda); background: #fff;
}
.campo textarea { min-height: 110px; resize: vertical; }
.campo .ajuda { font-size: 0.82rem; color: var(--texto-suave); margin-top: 4px; }
.erro-msg { background: var(--erro-fundo); color: var(--erro); padding: 12px 14px; border-radius: var(--raio-pequeno); margin-bottom: 14px; }
.ok-msg { background: #E3EFE7; color: var(--ok); padding: 12px 14px; border-radius: var(--raio-pequeno); margin-bottom: 14px; }

/* Nota 1 a 5 */
.notas { display: flex; gap: 8px; }
.notas label {
    flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--raio-pequeno); background: var(--card-suave); cursor: pointer; font-weight: 600; position: relative;
}
.notas input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.notas input:checked + span { color: #fff; }
.notas label:has(input:checked) { background: var(--primaria); }
.notas label:has(input:focus-visible) { outline: 3px solid var(--primaria); outline-offset: 2px; }
.legenda-notas { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--texto-suave); margin-top: 4px; }

.registro-diario { display: flex; gap: 12px; align-items: flex-start; }
.registro-diario .nota-bolinha {
    width: 40px; height: 40px; border-radius: 50%; background: var(--rosa); flex: 0 0 40px;
    display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.registro-diario .data { font-size: 0.82rem; color: var(--texto-suave); }

/* Auth */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; }
.auth .pagina { width: 100%; }
.auth .marca { justify-content: center; flex-direction: column; text-align: center; gap: 6px; margin-bottom: 28px; }
.auth .marca img { width: 64px; height: 64px; border-radius: 18px; }

/* Lista simples (FAQ, links) */
.lista-links { list-style: none; }
.lista-links li a, .lista-links li button {
    display: flex; align-items: center; justify-content: space-between; min-height: 48px;
    padding: 0 4px; text-decoration: none; color: inherit; border: 0; background: none; width: 100%; cursor: pointer;
    border-bottom: 1px solid var(--borda);
}
.lista-links li:last-child a, .lista-links li:last-child button { border-bottom: 0; }
details.faq summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 500; }
details.faq p { padding: 0 0 12px; color: var(--texto); font-size: 0.95rem; }

.rodape-aviso { font-size: 0.78rem; color: var(--texto-suave); text-align: center; margin-top: 20px; }
.vazio { text-align: center; color: var(--texto-suave); padding: 24px 8px; }

/* Navegação inferior */
.nav-inferior {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255,255,255,0.96); backdrop-filter: blur(8px);
    border-top: 1px solid var(--borda);
    display: flex; justify-content: space-around;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
}
.nav-inferior a {
    flex: 1; max-width: 120px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; text-decoration: none; color: var(--texto-suave); font-size: 0.72rem; font-weight: 500;
}
.nav-inferior a svg { width: 24px; height: 24px; fill: currentColor; }
.nav-inferior a.ativo { color: var(--primaria-escura); }

/* Telas maiores: centraliza e dá respiro */
@media (min-width: 600px) {
    .pagina { padding-top: 32px; }
    .nav-inferior { max-width: var(--largura-max); margin: 0 auto; border-radius: 18px 18px 0 0; border: 1px solid var(--borda); border-bottom: 0; }
}
