/* ============================================
   COMPONENTS — Sua Assinatura Genética
   Cards, campos, progress bar, botões
   ============================================ */

/* ─── Header / Progress Bar ─── */

.header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-document);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-step {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-section-name {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  min-width: 80px;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-bar);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Step Dots ─── */

.step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 16px 0 8px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.step-dot.completed {
  background: var(--accent);
  opacity: 0.5;
}

.step-dot:hover {
  transform: scale(1.4);
  background: var(--accent);
}

/* ─── Section Container ─── */

.section-page {
  padding: 24px 0 100px;
  min-height: calc(100vh - 60px);
}

.section-header {
  margin-bottom: 32px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  font-size: 26px;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

.section-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Field Group ─── */

.field-group {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px var(--shadow);
  transition: border-color 0.2s ease;
}

.field-group:hover {
  border-color: var(--border);
}

.field-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

/* ─── Field ─── */

.field {
  margin-bottom: 24px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.field-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.field-required::after {
  content: ' *';
  color: var(--error);
  font-weight: 400;
}

.field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Input Number / Text ─── */

.input-field {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-document);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

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

.input-field::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.input-field.has-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 0;
}

.input-with-unit .input-field {
  border-radius: 8px 0 0 8px;
  border-right: none;
}

.input-unit {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--border-light);
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  white-space: nowrap;
}

/* Input compacto para labs */
.input-compact {
  max-width: 140px;
}

/* ─── Pill Buttons (Select / Multiselect) ─── */

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-document);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--accent);
  background: var(--accent-lighter);
}

.pill.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

/* ─── Boolean (Sim/Não) ─── */

.bool-group {
  display: flex;
  gap: 8px;
}

.bool-btn {
  flex: 1;
  max-width: 120px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-document);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.bool-btn:hover {
  border-color: var(--accent);
}

.bool-btn.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Scale (1-5, 0-3, 0-4) ─── */

.scale-group {
  display: flex;
  gap: 0;
  width: 100%;
}

.scale-btn {
  flex: 1;
  padding: 10px 4px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-document);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.scale-btn:first-child { border-radius: 8px 0 0 8px; }
.scale-btn:last-child { border-radius: 0 8px 8px 0; }
.scale-btn:not(:first-child) { border-left: none; }

.scale-btn:hover {
  background: var(--accent-lighter);
}

.scale-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.scale-label-text {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ─── Validated Scale (GAD-7 / PHQ-9 / PSQI) ─── */

.validated-scale {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px var(--shadow);
}

.validated-scale-header {
  padding: 16px 24px;
  background: var(--accent-lighter);
  border-bottom: 1px solid var(--border-light);
}

.validated-scale-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.validated-scale-instruction {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.validated-scale-body {
  padding: 20px 24px;
}

.scale-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.scale-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.scale-item-label {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

.scale-item-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.scale-item-btn {
  padding: 8px 4px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--bg-document);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.3;
}

.scale-item-btn:hover {
  border-color: var(--accent);
  background: var(--accent-lighter);
}

.scale-item-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 500;
}

.validated-scale-footer {
  padding: 12px 24px;
  background: var(--accent-lighter);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scale-score {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.scale-classification {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── Ranking (Drag or Select) ─── */

.rank-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-document);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.rank-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 50%;
  flex-shrink: 0;
}

.rank-item-label {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.rank-select {
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
}

/* ─── Alert Box ─── */

.alert {
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
}

.alert-icon {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.alert-danger {
  background: var(--error-bg);
  border: 1px solid var(--error);
  color: var(--error);
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.alert-info {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* ─── Navigation Buttons ─── */

.nav-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-document);
  border-top: 1px solid var(--border-light);
  padding: 16px 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn {
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn-large {
  padding: 16px 40px;
  font-size: 16px;
  border-radius: 10px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Hero Page ─── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background: var(--gradient-hero);
}

.hero-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 32px;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 480px;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
  align-items: center;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.hero-meta-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

/* ─── Summary Page ─── */

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px var(--shadow);
}

.summary-metric {
  text-align: center;
  padding: 12px;
}

.summary-metric-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.summary-metric-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 8px;
}

.summary-metric-class {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

/* ─── Disclaimer ─── */

.disclaimer {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  padding: 24px 20px;
  border-top: 1px solid var(--border-light);
  margin-top: 40px;
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
  .header-section-name { display: none; }

  .scale-item-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .pill-group {
    gap: 6px;
  }

  .pill {
    padding: 7px 12px;
    font-size: 13px;
  }

  .nav-buttons {
    padding: 12px 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .section-title {
    font-size: 22px;
  }

  .field-group {
    padding: 20px 16px;
  }

  .validated-scale-header,
  .validated-scale-body,
  .validated-scale-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .scale-item-options {
    grid-template-columns: 1fr 1fr;
  }

  .bool-btn {
    max-width: none;
  }
}
