:root {
  --bg: #000000;
  --bg-card: #0f0f0f;
  --bg-elevated: #161616;
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.72);
  --accent: #b89c7c;
  --accent-soft: rgba(184, 156, 124, 0.18);
  --accent-border: rgba(184, 156, 124, 0.35);
  --line: rgba(184, 156, 124, 0.22);
  --danger: #d4756a;
  --ok: #8fbf9a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --theme-btn-bg: rgba(255, 255, 255, 0.08);
  --theme-btn-border: rgba(184, 156, 124, 0.4);
  --logo-pad: transparent;
}

html[data-theme="light"] {
  --bg: #f4f0ea;
  --bg-card: #ffffff;
  --bg-elevated: #faf8f5;
  --text: #1a1612;
  --text-soft: rgba(26, 22, 18, 0.7);
  --accent: #8f7352;
  --accent-soft: rgba(143, 115, 82, 0.12);
  --accent-border: rgba(143, 115, 82, 0.35);
  --line: rgba(143, 115, 82, 0.22);
  --danger: #b54a3e;
  --ok: #3d7a52;
  --shadow: 0 20px 50px rgba(80, 60, 40, 0.12);
  --theme-btn-bg: #fff;
  --theme-btn-border: rgba(143, 115, 82, 0.4);
  --logo-pad: #0f0f0f;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 50% -10%, rgba(184, 156, 124, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 30% at 100% 100%, rgba(184, 156, 124, 0.06), transparent 45%);
  pointer-events: none;
  z-index: 0;
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 70% 40% at 50% -10%, rgba(143, 115, 82, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 30% at 100% 100%, rgba(143, 115, 82, 0.08), transparent 45%);
}

/* —— Theme toggle —— */
.theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 10px;
  margin: 0;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}

.theme-toggle__text {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

/* —— Top ticker —— */
.ticker {
  position: relative;
  z-index: 2;
  background: #000;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  padding: 0.65rem 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.ticker-track {
  display: inline-block;
  animation: ticker 28s linear infinite;
  padding-left: 100%;
}

.ticker-track span {
  margin-right: 1.5rem;
}

.ticker-track span::after {
  content: "·";
  margin-left: 1.5rem;
  color: var(--accent);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
}

/* —— Hero —— */
.hero {
  text-align: center;
  padding: 1.75rem 0 2rem;
  animation: rise 0.8s ease both;
}

.brand-logo {
  display: block;
  width: min(260px, 70vw);
  height: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
  animation: rise 0.8s ease both;
  padding: 0.75rem;
  border-radius: 20px;
  background: var(--logo-pad);
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.85rem;
}

.brand span {
  display: block;
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
  font-size: 0.42em;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.45em;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.8vw, 1.55rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.hero p {
  color: var(--accent);
  font-size: 0.98rem;
  max-width: 36ch;
  margin: 0 auto;
}

/* —— Shell / progress —— */
.shell {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2rem);
  animation: rise 0.9s 0.1s ease both;
}

.progress {
  margin-bottom: 1.75rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.progress-meta strong {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* —— Panels —— */
.panel {
  display: none;
}

.panel.is-active {
  display: block;
  animation: fadeSlide 0.45s ease both;
}

.panel-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.panel-sub {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* —— Form fields —— */
.field {
  margin-bottom: 1.15rem;
}

.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.field input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  background: var(--bg-elevated);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input.is-invalid {
  border-color: var(--danger);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.35rem;
  min-height: 1.1em;
}

/* —— Question —— */
.q-greeting {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.15rem);
  font-style: italic;
  color: var(--accent);
  margin-bottom: 0.85rem;
  animation: fadeSlide 0.45s ease both;
}

.q-number {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.q-text {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.8vw, 1.55rem);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.options {
  display: grid;
  gap: 0.65rem;
}

.option {
  appearance: none;
  border: 1px solid var(--accent-border);
  background: var(--bg-elevated);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: left;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.option:hover {
  border-color: var(--accent);
  transform: translateX(3px);
  background: #1a1a1a;
}

.option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-score {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(184, 156, 124, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.option.is-selected .option-score {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* —— Actions —— */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.6rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, opacity 0.2s, color 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  flex: 1;
  min-width: 140px;
}

.btn-primary:hover:not(:disabled) {
  background: #c9af91;
  color: #000;
}

html[data-theme="light"] .btn-primary {
  color: #fff;
}

html[data-theme="light"] .btn-primary:hover:not(:disabled) {
  background: #7a6345;
  color: #fff;
}

html[data-theme="light"] .btn-whatsapp {
  color: #fff;
}

html[data-theme="light"] .btn-whatsapp:hover {
  background: #7a6345;
  color: #fff;
}

html[data-theme="light"] .option-score {
  color: var(--accent);
}

html[data-theme="light"] .option.is-selected .option-score {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--accent-border);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.btn-whatsapp {
  background: var(--accent);
  color: #000;
  width: 100%;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 28px rgba(184, 156, 124, 0.25);
}

.btn-whatsapp:hover {
  background: #c9af91;
  color: #000;
  text-decoration: none;
}

.btn-whatsapp::before {
  content: "";
  width: 1.15rem;
  height: 1.15rem;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12.04 2c-5.46 0-9.91 4.45-9.91 9.91 0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21 5.46 0 9.91-4.45 9.91-9.91S17.5 2 12.04 2zm5.79 14.18c-.24.68-1.4 1.25-1.94 1.33-.5.07-1.13.1-1.82-.11-.42-.13-.96-.31-1.65-.61-2.9-1.25-4.79-4.17-4.94-4.36-.14-.19-1.2-1.6-1.2-3.05s.76-2.16 1.03-2.46c.27-.3.59-.37.79-.37h.57c.18 0 .42-.07.66.5.24.58.82 2 .89 2.15.07.15.12.32.02.52-.1.2-.15.32-.3.5-.15.17-.31.39-.45.52-.15.15-.3.31-.13.6.17.3.75 1.24 1.61 2.01 1.11.99 2.04 1.3 2.34 1.45.3.15.47.12.65-.07.18-.2.75-.87.95-1.17.2-.3.4-.25.67-.15.27.1 1.71.81 2.01.95.3.15.5.22.57.34.08.13.08.74-.16 1.42z'/%3E%3C/svg%3E");
}

/* —— Result —— */
.result {
  text-align: center;
  padding: 0.5rem 0;
}

.result-hello {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.2vw, 1.25rem);
  color: var(--accent);
  margin-bottom: 0.35rem !important;
  font-weight: 500;
}

.community-cta {
  margin-top: 1.5rem;
  padding: 1.25rem 1.1rem;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-border);
  animation: rise 0.7s 0.15s ease both;
}

.community-msg {
  font-size: 1rem !important;
  color: var(--accent) !important;
  font-weight: 500;
  max-width: 36ch !important;
  margin-bottom: 1rem !important;
}

.actions-result {
  justify-content: center;
  margin-top: 1.25rem;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  min-height: 7.5rem;
  border-radius: 50%;
  margin: 0.5rem auto 1.25rem;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: #000;
  border: 1px solid var(--accent-border);
  animation: pulseIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-badge.minima { background: linear-gradient(145deg, #c9af91, #b89c7c); }
.result-badge.leve { background: linear-gradient(145deg, #d4b896, #a88968); }
.result-badge.moderada { background: linear-gradient(145deg, #c4a06a, #8a6f48); color: #fff; }
.result-badge.severa { background: linear-gradient(145deg, #c47a6a, #8a4a3e); color: #fff; }

.result h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.result .nivel-nome {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.result p {
  color: var(--text-soft);
  font-size: 0.98rem;
  max-width: 42ch;
  margin: 0 auto 1rem;
}

.result-note {
  font-size: 0.82rem;
  color: var(--accent);
  opacity: 0.85;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.status-msg {
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.3em;
}

.status-msg.ok { color: var(--ok); }
.status-msg.err { color: var(--danger); }

.disclaimer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--accent);
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 480px) {
  .wrap {
    width: calc(100% - 1.25rem);
    padding-top: 1.25rem;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
  }
}

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

  .ticker-track {
    padding-left: 1rem;
    animation: none;
    white-space: normal;
    text-align: center;
    display: block;
  }
}
