/* --------------------------------------------------------
   Vida Com Cristo Quiz — tema fiel ao original do Inlead
   themeColor #fbbf24 | bg #fff7ed | title #422006 | text #451a03
-------------------------------------------------------- */

:root {
  --theme: #fbbf24;
  --theme-dark: #d97706;
  --bg: #fff7ed;
  --surface: #fff;
  --title: #422006;
  --text: #451a03;
  --muted: #78716c;
  --danger-bg: #fef2f2;
  --danger-border: #ef4444;
  --danger-text: #991b1b;
  --success-bg: #f0fdf4;
  --success-border: #22c55e;
  --success-text: #166534;
  --info-bg: #fffbeb;
  --info-border: #f59e0b;
  --info-text: #92400e;
  --shadow: 0 1px 2px rgba(66,32,6,.06), 0 8px 24px rgba(66,32,6,.08);
  --shadow-lg: 0 4px 8px rgba(66,32,6,.08), 0 16px 40px rgba(66,32,6,.12);
  --radius: 1rem;
  --radius-lg: 1.25rem;
  --max: 640px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: var(--max);
  padding: 16px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -16px -16px 0;
  padding: 14px 16px 12px;
  background: var(--bg);
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(66,32,6,.06);
}
.topbar .logo { grid-column: 2; justify-self: center; }
.topbar .logo img { display: block; height: 44px; width: auto; }
.back {
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: var(--title);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.back:hover { background: rgba(66,32,6,.06); }
.back[hidden] { visibility: hidden; display: grid; }

.topbar-progress {
  grid-column: 1 / -1;
  height: 4px;
  background: rgba(251,191,36,.18);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
#progress-bar {
  height: 100%;
  width: 0;
  background: var(--theme);
  border-radius: 999px;
  transition: width .35s ease;
}

/* step container */
.step {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fade .25s ease;
}
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* layers */
.layer-text { color: var(--text); }
.layer-text h1, .layer-text h2, .layer-text h3 {
  color: var(--title);
  margin: 0;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.layer-text h1 { font-size: clamp(1.6rem, 5vw, 2.05rem); }
.layer-text h2 { font-size: clamp(1.25rem, 4vw, 1.55rem); }
.layer-text h3 { font-size: 1.1rem; font-weight: 700; }
.layer-text p { margin: .5em 0; }
.layer-text ul { padding-left: 1.25em; margin: .5em 0; }
.layer-text ul li { margin: .35em 0; }
.layer-text strong { color: var(--title); }
.layer-text .ql-align-center { text-align: center; }
.layer-text .ql-size-large { font-size: 1.25em; }

.layer-image {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0,0,0,.04);
}
.layer-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.layer-clear { display: block; }

/* alert */
.layer-alert {
  border-radius: var(--radius);
  padding: 14px 16px;
  border-left: 4px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info-text);
}
.layer-alert.danger  { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }
.layer-alert.success { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.layer-alert p { margin: .3em 0; }
.layer-alert strong { color: inherit; }

/* options (choices) */
.layer-options {
  display: grid;
  gap: 12px;
}
.layer-options.cols-2 { grid-template-columns: 1fr 1fr; }
.option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 56px;
  text-align: left;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.option:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); border-color: var(--theme); }
.option:active { transform: translateY(0); }
.option.selected { border-color: var(--theme); background: #fffbeb; }
.option .emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex: 0 0 auto;
}
.option .label { flex: 1; }
.option .label p { margin: 0; }
.option .check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #e7e5e4;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background .15s, border-color .15s;
}
.option.selected .check {
  background: var(--theme);
  border-color: var(--theme);
  color: var(--title);
}

/* field (input) */
.layer-field { display: flex; flex-direction: column; gap: 8px; }
.layer-field label { font-weight: 600; color: var(--title); }
.layer-field input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  background: var(--surface);
  border: 2px solid #fed7aa;
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.layer-field input:focus {
  border-color: var(--theme);
  box-shadow: 0 0 0 4px rgba(251,191,36,.25);
}

/* button */
.layer-button { display: flex; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--theme);
  color: var(--title);
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .01em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 0 var(--theme-dark), var(--shadow);
  transition: transform .08s ease, box-shadow .12s ease, background .15s;
  text-decoration: none;
}
.btn:hover { background: #fcd34d; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 0 var(--theme-dark), var(--shadow); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: var(--shadow); transform: none; }
.btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 0 0 var(--theme-dark), 0 0 0 0 rgba(251,191,36,.55); }
  50%      { box-shadow: 0 4px 0 0 var(--theme-dark), 0 0 0 14px rgba(251,191,36,0); }
}

/* loading */
.layer-loading {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.layer-loading .title {
  font-weight: 700;
  color: var(--title);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.layer-loading .desc { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.layer-loading .desc p { margin: 0; }
.layer-loading .bar {
  height: 10px;
  background: rgba(251,191,36,.18);
  border-radius: 999px;
  overflow: hidden;
}
.layer-loading .fill {
  height: 100%;
  width: 0;
  background: var(--theme);
  border-radius: 999px;
  transition: width .2s linear;
}
.layer-loading .pct { font-variant-numeric: tabular-nums; color: var(--theme-dark); }

/* arguments (grid of cards) */
.layer-arguments {
  display: grid;
  gap: 12px;
}
.layer-arguments.cols-2 { grid-template-columns: 1fr 1fr; }
.argument {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.argument .emoji { font-size: 2rem; line-height: 1; }
.argument .arg-text { font-size: .95rem; }
.argument .arg-text p { margin: 0; }

/* metric (progress dot row) */
.layer-metric {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
}
.layer-metric .m-title { font-weight: 700; color: var(--title); }
.layer-metric .m-pct {
  color: var(--success-text);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.layer-metric .m-pct .dot {
  width: 10px; height: 10px;
  background: #22c55e;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(34,197,94,.18);
}
.layer-metric .m-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: rgba(34,197,94,.18);
  border-radius: 999px;
  overflow: hidden;
}
.layer-metric .m-bar .m-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 999px;
  transition: width .8s ease;
}

/* error message under field */
.field-error {
  color: var(--danger-text);
  font-size: .9rem;
  margin: 4px 2px 0;
  min-height: 1.2em;
}

/* utility */
[hidden] { display: none !important; }

@media (max-width: 380px) {
  .layer-options.cols-2 { grid-template-columns: 1fr; }
  .layer-arguments.cols-2 { grid-template-columns: 1fr; }
}
