/* Fotobase — base da plataforma e do painel.
   Conceito: folha de contato sobre a mesa de luz; o vermelho é o lápis que marca o quadro escolhido. */
@import url("/static/css/fontes.css");

:root {
  --mesa: #F2F3F1;        /* fundo: mesa de luz, branco frio */
  --folha: #FFFFFF;       /* superfícies */
  --grafite: #24272B;     /* texto */
  --cinza: #656B72;       /* texto secundário */
  --linha: #D5D8D4;       /* divisões */
  --linha-forte: #B9BDB8;
  --lapis: #C4122F;       /* ação principal e marcações */
  --lapis-escuro: #9C0E25;
  --ambar: #B7791F;       /* atenção */
  --ambar-fundo: #FBF1DF;
  --verde: #2B7656;       /* concluído */
  --verde-fundo: #E5F2EB;
  --erro-fundo: #FBE7EA;
  --raio: 6px;
  --raio-grande: 10px;
  --sombra: 0 1px 2px rgba(36, 39, 43, .08), 0 4px 14px rgba(36, 39, 43, .06);
  --fonte: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --passo: 8px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--mesa); color: var(--grafite);
  font: 400 16px/1.55 var(--fonte); font-variation-settings: "wdth" 100;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--lapis); }
:focus-visible { outline: 2px solid var(--lapis); outline-offset: 2px; border-radius: 3px; }

/* Títulos em largura condensada: tom de etiqueta de rolo de filme, sem caixa-alta */
h1, h2, h3 { font-variation-settings: "wdth" 78; line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; max-width: 68ch; }
.discreto { color: var(--cinza); }
.pequeno { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- formulários ---------- */
label { display: block; font-weight: 550; font-size: .925rem; margin: 0 0 4px; }
.campo { margin-bottom: 16px; }
.campo .ajuda { font-size: .825rem; color: var(--cinza); margin-top: 4px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=color], select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--folha);
  border: 1px solid var(--linha-forte); border-radius: var(--raio); padding: 10px 12px; min-height: 44px;
}
input[type=color] { padding: 4px; width: 64px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--grafite); outline: none; box-shadow: 0 0 0 3px rgba(196, 18, 47, .15); }
.linha-campos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border-radius: var(--raio); border: 1px solid var(--grafite); background: var(--folha);
  color: var(--grafite); font: 600 .95rem var(--fonte); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.botao:hover { background: var(--mesa); color: var(--grafite); }
.botao.principal { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.botao.principal:hover { background: var(--lapis-escuro); border-color: var(--lapis-escuro); color: #fff; }
.botao.leve { border-color: transparent; background: transparent; text-decoration: underline; padding: 0 8px; }
.botao:disabled { opacity: .55; cursor: not-allowed; }
.botao.pequeno { min-height: 34px; padding: 0 12px; font-size: .875rem; }

/* chave liga/desliga */
.chave { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.chave input { opacity: 0; width: 0; height: 0; position: absolute; }
.chave span { position: absolute; inset: 0; background: var(--linha-forte); border-radius: 26px; transition: background .15s; cursor: pointer; }
.chave span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.chave input:checked + span { background: var(--grafite); }
.chave input:checked + span::after { transform: translateX(20px); }
.chave input:focus-visible + span { outline: 2px solid var(--lapis); outline-offset: 2px; }

/* avisos */
.aviso { border-radius: var(--raio); padding: 12px 14px; margin: 0 0 16px; background: var(--ambar-fundo); border-left: 4px solid var(--ambar); }
.aviso.erro { background: var(--erro-fundo); border-left-color: var(--lapis); }
.aviso.ok { background: var(--verde-fundo); border-left-color: var(--verde); }
.etiqueta { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--mesa); border: 1px solid var(--linha); white-space: nowrap; }
.etiqueta.ok { background: var(--verde-fundo); border-color: transparent; color: var(--verde); }
.etiqueta.atencao { background: var(--ambar-fundo); border-color: transparent; color: #7A4F0F; }
.etiqueta.vermelha { background: var(--erro-fundo); border-color: transparent; color: var(--lapis-escuro); }

/* folha: superfície branca sobre a mesa */
.folha { background: var(--folha); border: 1px solid var(--linha); border-radius: var(--raio-grande); padding: 20px; }
.folha + .folha { margin-top: 16px; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linha); }
.lista > li:first-child { border-top: 0; }
.lista .cresce { flex: 1; min-width: 0; }

/* aviso flutuante (toast) */
#avisos { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--grafite); color: #fff; padding: 12px 16px; border-radius: var(--raio); box-shadow: var(--sombra); }
.toast.erro { background: var(--lapis-escuro); }

/* marca de lápis: círculo traçado à mão (usada em seleções e passos concluídos) */
.marca-lapis path { fill: none; stroke: var(--lapis); stroke-width: 2.4; stroke-linecap: round; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
