:root {
  --primary: #EF3124;
  --primary-dark: #C8261B;
  --primary-soft: #FFE8E6;
  --bg: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #5A5A5A;
  --ink-mute: #8A8A8A;
  --border: #ECECEC;
  --radius: 14px;
  --radius-sm: 10px;
  --font: Verdana, Geneva, Tahoma, "DejaVu Sans", sans-serif;
  --tap: 52px;
  --max-w: 480px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- screens ---------- */

.screen {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 16px;
  animation: fade-in 220ms ease-out;
}
.screen[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- typography ---------- */

.t-title {
  font-size: 24px;
  font-weight: bold;
  margin: 4px 0 0;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.t-subtitle {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}

/* ---------- maneki ---------- */

.maneki {
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(239, 49, 36, 0.18);
  flex: 0 0 auto;
}
.maneki img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.45);
  filter: hue-rotate(-10deg) saturate(1.15);
}
.maneki--big {
  width: 220px;
  height: 220px;
}
.maneki--mid {
  width: 160px;
  height: 160px;
  margin: 8px auto;
}

/* ---------- welcome ---------- */

.screen--welcome {
  justify-content: center;
  text-align: center;
  gap: 18px;
}
.welcome-hero {
  display: flex;
  justify-content: center;
  margin-top: auto;
}
.screen--welcome .btn {
  margin-top: auto;
}

/* ---------- buttons ---------- */

.btn {
  appearance: none;
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
  font-weight: bold;
  min-height: var(--tap);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 12px 18px;
  transition: transform 80ms ease, background 120ms ease;
}
.btn:active { transform: scale(0.98); background: var(--primary-dark); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--block { width: 100%; }

.btn--ghost {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn--ghost:active { background: var(--primary-soft); }

/* ---------- quiz ---------- */

.screen--quiz { gap: 14px; }

.quiz-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-progress-label {
  font-size: 13px;
  color: var(--ink-mute);
  font-weight: bold;
}
.quiz-progress-bar {
  background: var(--border);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}
.quiz-progress-bar__fill {
  background: var(--primary);
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 280ms ease;
}

.quiz-question {
  font-size: 19px;
  font-weight: bold;
  margin: 4px 0 4px;
  text-align: center;
  line-height: 1.35;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-bottom: 4px;
}
.quiz-option {
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 15px;
  min-height: var(--tap);
  cursor: pointer;
  line-height: 1.35;
  transition: border-color 120ms ease, background 120ms ease, transform 80ms ease;
}
.quiz-option:hover { border-color: var(--primary); }
.quiz-option:active { transform: scale(0.99); background: var(--primary-soft); border-color: var(--primary); }

/* ---------- result ---------- */

.screen--result { gap: 14px; }

.result-burst {
  background: var(--primary);
  color: #fff;
  border-radius: 22px;
  padding: 26px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(239, 49, 36, 0.30);
}
.result-burst::before, .result-burst::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  pointer-events: none;
}
.result-burst::before {
  width: 180px; height: 180px;
  top: -60px; left: -50px;
}
.result-burst::after {
  width: 140px; height: 140px;
  bottom: -50px; right: -40px;
}
.result-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 10px;
  position: relative;
}
.result-headline {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 10px;
  position: relative;
  letter-spacing: -0.2px;
}
.result-description {
  font-size: 14px;
  opacity: 0.95;
  margin: 0;
  position: relative;
}

.result-subline {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 6px 0 0;
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.result-item__emoji {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex: 0 0 32px;
}
.result-item__title {
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: bold;
  color: var(--ink);
}
.result-item__pct {
  font-size: 14px;
  font-weight: bold;
  color: var(--primary);
  flex: 0 0 auto;
}

.screen--result .btn { margin-top: auto; }

/* ---------- lead form ---------- */

.screen--lead { gap: 12px; }

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 13px;
  font-weight: bold;
  color: var(--ink-soft);
}
.field-input {
  font-family: var(--font);
  font-size: 16px;
  padding: 14px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  min-height: var(--tap);
  outline: none;
  transition: border-color 120ms ease;
}
.field-input:focus { border-color: var(--primary); }
.field-input.is-invalid { border-color: var(--primary); background: var(--primary-soft); }

.field-error {
  font-size: 12px;
  color: var(--primary);
  font-weight: bold;
}
.field-error--center { text-align: center; }

.contact-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.contact-switch__btn {
  flex: 1 1 0;
  appearance: none;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: bold;
  color: var(--ink-soft);
  padding: 10px;
  cursor: pointer;
  min-height: 40px;
}
.contact-switch__btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
  cursor: pointer;
}
.checkbox input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  margin: 0;
  flex: 0 0 22px;
}
.checkbox a {
  color: var(--primary);
  text-decoration: underline;
  margin-left: 4px;
}

/* honeypot — visually hidden but in DOM */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- outro ---------- */

.screen--outro {
  text-align: center;
  justify-content: center;
  gap: 18px;
}
.screen--outro .maneki { margin-top: auto; }
.screen--outro .btn { margin-top: auto; }

/* ---------- loading ---------- */

.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--ink-mute);
  font-family: var(--font);
}
.loading[hidden] { display: none; }

/* ---------- small phones ---------- */

@media (max-height: 640px) {
  .maneki--big { width: 160px; height: 160px; }
  .maneki--mid { width: 120px; height: 120px; }
  .t-title { font-size: 21px; }
  .quiz-question { font-size: 17px; }
}
