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

:root {
  --rose: #d4788c;
  --rose-dark: #b85c72;
  --cream: #fdf6f2;
  --ink: #3a2e33;
  --muted: #8a7a80;
  --card: #ffffff;
  --green: #25d366;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(58, 46, 51, 0.10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; color: var(--rose-dark); letter-spacing: 0.3px; }
.lang-toggle {
  border: 1.5px solid var(--rose); color: var(--rose-dark); background: none;
  border-radius: 999px; padding: 4px 14px; font-weight: 600; cursor: pointer;
}

.demo-banner {
  background: #fff3cd; color: #7a5d00; text-align: center;
  padding: 8px 12px; font-size: 0.85rem; font-weight: 600;
}

main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 24px 18px 40px; }

.step h1 { font-size: 1.55rem; line-height: 1.3; margin-bottom: 12px; }
.step h2 { font-size: 1.3rem; margin-bottom: 12px; }
.step p { color: var(--muted); line-height: 1.55; margin-bottom: 16px; }
.center { text-align: center; padding-top: 48px; }
.hidden { display: none !important; }

.consent {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin: 18px 0; font-size: 0.9rem; line-height: 1.45; cursor: pointer;
}
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--rose); flex-shrink: 0; }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  border: none; border-radius: 999px; padding: 14px 18px;
  font-size: 1rem; font-weight: 700; cursor: pointer; transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--rose); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--rose-dark); }
.btn.secondary { background: #fff; color: var(--rose-dark); border: 1.5px solid var(--rose); }
.btn.ghost { background: none; color: var(--muted); }
.btn.whatsapp { background: var(--green); color: #fff; }

.fineprint { font-size: 0.78rem; color: var(--muted); margin-top: 14px; }

.tips { list-style: none; margin-bottom: 14px; }
.tips li { font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
.tips li b { color: var(--rose-dark); }

.howto {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin: 18px 0;
}
.howto h3 { font-size: 1rem; margin-bottom: 10px; color: var(--ink); }
.howto .tips { margin-bottom: 0; }

.camera-wrap {
  position: relative; width: 100%; aspect-ratio: 3 / 4;
  border-radius: var(--radius); overflow: hidden; background: #1a1418;
}
#video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-guide {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -52%);
  width: 62%; aspect-ratio: 3 / 4;
  border: 3px dashed rgba(255, 255, 255, 0.85); border-radius: 50%;
  pointer-events: none;
}

.spinner {
  width: 52px; height: 52px; margin: 0 auto 20px;
  border: 5px solid #f0dde3; border-top-color: var(--rose);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.overall-card {
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; text-align: center; margin-bottom: 16px;
}
.overall-score { font-size: 3rem; font-weight: 800; line-height: 1; }
.overall-score small { font-size: 1.1rem; font-weight: 600; opacity: 0.85; }
.overall-summary { color: rgba(255, 255, 255, 0.95) !important; margin: 10px 0 0 !important; font-size: 0.95rem; }

.heatmap-card, .concern-list {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.heatmap-card h3 { margin-bottom: 12px; font-size: 1.05rem; }
.heatmap-wrap { border-radius: 12px; overflow: hidden; }
#heatmapCanvas, #heatmapImg { width: 100%; display: block; }

.mask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mask-chip {
  border: 1.5px solid #eddce2; background: #faf3f5; color: var(--ink);
  border-radius: 999px; padding: 5px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.mask-chip.active { background: var(--rose); border-color: var(--rose); color: #fff; }

.concern-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f5ebee; }
.concern-item:last-child { border-bottom: none; }
.concern-label { flex: 1; font-size: 0.92rem; font-weight: 600; }
.concern-bar { flex: 2; height: 8px; background: #f0e4e8; border-radius: 999px; overflow: hidden; }
.concern-bar-fill { height: 100%; border-radius: 999px; }
.concern-score { width: 34px; text-align: right; font-weight: 700; font-size: 0.9rem; }
.concern-text { font-size: 0.8rem; color: var(--muted); width: 100%; margin: 2px 0 4px !important; }
.concern-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.concern-wrap { display: flex; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid #f5ebee; }
.concern-wrap:last-child { border-bottom: none; }

.compare-wrap {
  position: relative; width: 100%; border-radius: var(--radius);
  overflow: hidden; user-select: none; touch-action: none; box-shadow: var(--shadow);
}
.compare-wrap img { width: 100%; display: block; pointer-events: none; }
.compare-after {
  position: absolute; inset: 0; width: 100%;
  clip-path: inset(0 50% 0 0);
}
.compare-after img { width: 100%; height: 100%; }
.compare-handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--rose-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; box-shadow: var(--shadow); cursor: ew-resize;
}

.disclaimer {
  background: #fff3cd; color: #7a5d00 !important; border-radius: 12px;
  padding: 12px 14px; font-size: 0.82rem !important; margin-top: 14px;
}

.footer { text-align: center; font-size: 0.75rem; color: var(--muted); padding: 16px; }

@media (min-width: 700px) {
  .actions { flex-direction: row; }
  .btn { width: auto; flex: 1; }
}
