@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

:root {
  --creme: #fbf6f4;
  --vinho: #8a3a52;
  --vinho-escuro: #6e2c41;
  --texto: #2b1d22;
  --texto-suave: #6b5a60;
  --toque: 44px; /* área mínima de toque (regra 10) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--creme);
  color: var(--texto);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}

h1, .marca { font-family: "Playfair Display", Georgia, serif; }

/* ---------- Telas ---------- */
.tela {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tela.ativa { display: flex; }

/* ---------- Início ---------- */
#tela-inicio { justify-content: center; align-items: center; text-align: center; }
.inicio-conteudo { max-width: 360px; padding: 24px; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.marca { color: var(--vinho); font-size: 1.1rem; font-weight: 600; letter-spacing: .02em; }
h1 { font-size: 2.4rem; line-height: 1.1; font-weight: 700; color: var(--vinho); }
.subtitulo { font-size: 1.05rem; color: var(--texto-suave); line-height: 1.45; }
.aviso-lgpd { font-size: .8rem; color: var(--texto-suave); line-height: 1.4; margin-top: 8px; }
.versao { position: absolute; bottom: calc(8px + env(safe-area-inset-bottom)); width: 100%; text-align: center; font-size: .7rem; color: #b5a5aa; }

/* ---------- Botões ---------- */
.btn {
  min-height: var(--toque); min-width: var(--toque);
  border: none; border-radius: 999px;
  font: 600 1rem "Inter", system-ui, sans-serif;
  padding: 0 24px; cursor: pointer;
}
.btn-principal { background: var(--vinho); color: #fff; height: 52px; padding: 0 32px; }
.btn-principal:active { background: var(--vinho-escuro); }
.btn-secundario { background: #fff; color: var(--vinho); border: 1.5px solid var(--vinho); height: 52px; }
.btn-icone { background: rgba(255,255,255,.18); color: #fff; font-size: 1.5rem; width: 52px; height: 52px; padding: 0; }

/* ---------- Câmera e foto ---------- */
#tela-camera, #tela-foto { background: #000; }
.palco { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#video, #foto { width: 100%; height: 100%; object-fit: cover; }
#video.espelhado { transform: scaleX(-1); } /* câmera frontal se vê como no espelho */
#foto { object-fit: contain; }

.guia-rosto {
  position: absolute; top: 50%; left: 50%;
  width: 62%; aspect-ratio: 3 / 4;
  transform: translate(-50%, -54%);
  border: 2px dashed rgba(255,255,255,.7);
  border-radius: 50%;
  pointer-events: none;
}
.dica {
  position: absolute; top: 16px; left: 0; right: 0; text-align: center;
  color: #fff; font-size: .9rem; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  padding: 0 16px;
}
.selo-ilustrativo {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(251,246,244,.9); color: var(--vinho);
  font-size: .75rem; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}

.barra {
  display: flex; align-items: center; justify-content: space-around;
  padding: 16px 12px 20px; background: #000;
}
.barra-texto { background: var(--creme); gap: 12px; }
.barra-texto .btn { flex: 1; }

.btn-obturador {
  width: 76px; height: 76px; border-radius: 50%;
  background: #fff; border: 5px solid rgba(255,255,255,.4);
  background-clip: padding-box; cursor: pointer;
}
.btn-obturador:active { transform: scale(.94); }
.btn-obturador:disabled { opacity: .4; }

.erro {
  position: absolute; inset: 0; z-index: 2;
  background: var(--creme); color: var(--texto);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 32px; text-align: center; line-height: 1.5;
}
.erro[hidden] { display: none; }

.flash { position: fixed; inset: 0; background: #fff; opacity: .85; pointer-events: none; animation: flash .25s ease-out forwards; z-index: 10; }
@keyframes flash { to { opacity: 0; } }
