:root {
  color-scheme: light dark;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  --bg: #fdfdfd;
  --fg: #1f1f1f;
  --accent: #8b5cf6;
  --accent-strong: #6d28d9;
  --muted: #6b7280;
  --border: #d1d5db;
  --error: #dc2626;
  --success: #059669;
  
  /* Admin interface variables */
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary-color: #6b7280;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --input-bg: #ffffff;
  --header-bg: #f8fafc;
  --hover-bg: #f1f5f9;
  --success-color: #10b981;
  --success-hover: #059669;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --error-color: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --info-color: #3b82f6;
  --info-hover: #2563eb;
  --muted-color: #9ca3af;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101827;
    --fg: #f9fafb;
    --accent: #a855f7;
    --accent-strong: #7c3aed;
    --muted: #9ca3af;
    --border: #374151;
    
    /* Admin interface dark theme */
    --primary-color: #a855f7;
    --primary-hover: #9333ea;
    --secondary-color: #6b7280;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --card-bg: #1f2937;
    --border-color: #374151;
    --input-bg: #374151;
    --header-bg: #111827;
    --hover-bg: #374151;
    --success-color: #10b981;
    --success-hover: #059669;
    --success-bg: #064e3b;
    --success-border: #065f46;
    --error-color: #f87171;
    --error-bg: #7f1d1d;
    --error-border: #991b1b;
    --info-color: #60a5fa;
    --info-hover: #3b82f6;
    --muted-color: #6b7280;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.site-header img {
  display: block;
  width: 100%;
  height: auto;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

header,
section,
footer {
  margin-bottom: 2rem;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
input[type="radio"]:focus-visible,
input[type="range"]:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.intro {
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.highlight-box {
  background: rgba(255, 193, 7, 0.1);
  border: 2px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.citation {
  font-style: italic;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 1.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Bloco de convite por e-mail na intro */
.email-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
  justify-content: center; /* centraliza input e botão */
}

.email-invite > label {
  flex: 1 1 100%;
  font-weight: 600;
  margin-top: 0.75rem; /* "enter" antes do texto */
  margin-bottom: 0.125rem;
}

.email-invite > input[type="email"] {
  flex: 1 1 380px;
  min-width: 260px;
  max-width: 560px;
  padding: 0.75rem 1rem; /* altura semelhante ao .primary-button */
  border: 1px solid var(--border);
  border-radius: 999px; /* mesmo raio "pill" do botão */
  background: transparent;
  color: var(--fg);
  height: 48px; /* mesma altura do botão */
}

.email-invite > input[type="email"]::placeholder {
  color: var(--muted);
}

.email-invite > input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.email-invite > .primary-button {
  flex: 0 0 auto;
  min-height: 48px; /* garantir mesma altura */
  display: inline-flex;
  align-items: center;
}

@media (max-width: 560px) {
  .email-invite > input[type="email"],
  .email-invite > .primary-button {
    flex: 1 1 100%;
    width: 100%;
  }
}

.primary-button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
}

.question-panel {
  display: grid;
  gap: 1.5rem;
  border-radius: 16px;
  padding: 1.75rem;
  background: var(--bg);
  backdrop-filter: blur(8px);
}

.question-title {
  margin: 0;
  font-size: 1.4rem;
}

.alt-grid {
  display: grid;
  gap: 0.75rem;
}

.alt-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border 0.2s ease, transform 0.1s ease;
  cursor: pointer;
  text-align: left;
  background: transparent;
}

.alt-card[data-active="true"] {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: rgba(139, 92, 246, 0.08);
}

/* Card informativo da intro não é clicável */
.intro .alt-card[data-code="INFO"] {
  cursor: default;
  border: none;
  border-left: 8px solid #CEAA5B;
  border-radius: 0;
  background: transparent;
}

/* mantém o mesmo lift/transform padrão dos cards; apenas o cursor muda */

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

.alt-title {
  font-weight: 600;
}

.intensity-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.intensity-button {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  min-width: 3.5rem;
  text-align: center;
}

.intensity-button[data-active="true"] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.nav-buttons.has-both {
  justify-content: space-between;
}

.progress {
  font-weight: 600;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--error);
  font-weight: 600;
}

.info {
  color: var(--accent-strong);
  font-weight: 600;
}

.results {
  display: grid;
  gap: 2rem;
}

.results-footer {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
}

.results-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.button-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.totals-table {
  width: 100%;
  border-collapse: collapse;
}

.totals-table th,
.totals-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: center;
}

.totals-table th {
  background: rgba(139, 92, 246, 0.15);
}

.totals-table tr[data-highlight="dominant"] {
  background: rgba(34, 197, 94, 0.15);
}

.badge {
  display: block;
  width: 100%;
  text-align: center;
  background: rgba(139, 92, 246, 0.18);
  border-radius: 999px;
  padding: 1.25rem 1.5rem;
  margin: 0.75rem 0 1.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.interpretation {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.profiles {
  display: grid;
  gap: 1rem;
}

.profiles h3 {
  margin: 0.5rem 0;
}

.profiles-content {
  display: grid;
  gap: 1rem;
}

.profiles-content article {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(139, 92, 246, 0.06);
}

.profiles-content article h4 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.roda {
  width: 100%;
  max-width: none;
  margin: 0;
}

.roda svg {
  display: block;
  width: 100%;
  height: auto;
}

.bars {
  display: grid;
  gap: 0.75rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  gap: 0.75rem;
  align-items: center;
}

.bar-label {
  font-weight: 600;
}

.bar-track {
  position: relative;
  height: 12px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent);
}

.bar-value {
  text-align: right;
  font-weight: 700;
}

@media (max-width: 720px) {
  .bar-row {
    grid-template-columns: 92px 1fr 40px;
  }
}

@media (max-width: 720px) {
  .question-panel {
    padding: 1.25rem;
  }

  .intensity-options {
    flex-wrap: nowrap;
    gap: 0.25rem;
  }

  .intensity-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.4rem 0.35rem;
    font-size: 0.9rem;
  }

  .nav-buttons {
    flex-direction: column;
  }

  .nav-buttons button {
    width: 100%;
  }
}
