:root {
  --primary: #0f172a;       /* Slate 900 */
  --primary-light: #1e293b; /* Slate 800 */
  --accent: #2563eb;        /* Blue 600 */
  --accent-hover: #1d4ed8;  /* Blue 700 */
  --accent-cyan: #0284c7;   /* Sky 600 */
  --success: #10b981;       /* Emerald 500 */
  --warning: #f59e0b;       /* Amber 500 */
  --danger: #ef4444;        /* Red 500 */
  --bg: #f8fafc;            /* Slate 50 */
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px;
}

.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 32px 16px;
  text-align: center;
  border-bottom: 3px solid var(--accent);
}

.header .badge {
  display: inline-block;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.header p {
  color: #94a3b8;
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f1f5f9;
}

.section-title .step-num {
  background: var(--accent);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: #1e293b;
}

.form-group .hint {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background-color: #fff;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

.checkbox-group, .radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 10px;
  margin-top: 8px;
}

.check-item, .form-group label.check-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 0;
  font-weight: 500;
  line-height: 1.5;
  background: #fff;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.check-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.check-item input[type="checkbox"],
.check-item input[type="radio"] {
  flex: 0 0 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.slider-container {
  margin: 16px 0 8px 0;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.slider-labels span {
  text-align: center;
  max-width: 18%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
  width: 100%;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.footer {
  margin-top: auto;
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: white;
}

/* Gracias Screen */
.success-card {
  text-align: center;
  padding: 48px 24px;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  color: var(--success);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 20px;
}

/* Dashboard & Admin */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-box .val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-box .lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
}

.table-container {
  overflow-x: auto;
  margin-top: 16px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
}

table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data-table tr:hover {
  background: #f8fafc;
}

.badge-tag {
  display: inline-block;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 2px;
}

/* AI Dynamic Modal / Card */
.ai-results-card {
  background: #eff6ff;
  border: 2px solid #93c5fd;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.archetype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.archetype-card {
  background: white;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 16px;
}

.dupla-box {
  background: white;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

/* Diagnostic v2: accessible field groups and mobile matrices. */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; margin-bottom: 12px; font-size: .95rem; }
.option-separator { grid-column: 1 / -1; padding: 14px 0 6px; border-top: 1px solid #cbd5e1; }
.privacy-note { background: #eff6ff; border-left: 3px solid #2563eb; padding: 14px; font-size: .85rem; margin-top: 12px; }
.tool-group { border: 1px solid #cbd5e1; border-radius: 10px; margin: 16px 0; padding: 16px; }
.tool-group summary { cursor: pointer; font-weight: 700; }
.tool-row { margin-top: 20px; }
.segmented { display: flex; gap: 8px; }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented label > span { display: block; text-align: center; padding: 12px 4px; border: 1px solid #94a3b8; border-radius: 6px; cursor: pointer; }
.segmented input:checked + span { background: #1d4ed8; color: white; }
.segmented input:focus-visible + span { outline: 3px solid #f59e0b; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.hours-row { padding: 16px; background: #f8fafc; border: 1px solid #cbd5e1; margin: 20px 0; border-radius: 8px; }
.hours-row label { display: block; margin: 12px 0; }
.save-bar { background: #eff6ff; padding: 16px; border-radius: 10px; margin-top: 20px; }
.save-bar .btn { margin-top: 12px; }
[hidden] { display: none !important; }
.card > p { margin: 14px 0; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
@media (max-width: 600px) { .card { padding: 18px; } .stats-grid { grid-template-columns: 1fr 1fr; } .tool-group { padding: 10px; } }

.check-item:has(input:checked) { background: #eff6ff; border-color: #60a5fa; }
.check-item:focus-within { outline: 2px solid #2563eb; outline-offset: 2px; }
.check-item > span { min-width: 0; overflow-wrap: anywhere; }
.conditional-detail { padding: 16px; border-left: 3px solid #93c5fd; border-radius: 8px; background: #f8fafc; }
.participant-detail { margin: 8px 0; padding: 8px 10px; border-left: 2px solid #93c5fd; background: #f8fafc; font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; }
.participant-detail strong { display: block; color: #475569; }
