/* Teste de Harmonia Societária — Express */
/* Survey Styles */

:root {
  --bg-dark: #0f1117;
  --bg-card: #1a1d28;
  --bg-card-hover: #22263a;
  --bg-input: #252939;
  --border: #2e3347;
  --border-focus: #6366f1;
  --text-primary: #e8eaf0;
  --text-secondary: #9ca3b5;
  --text-muted: #6b7280;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --accent-hover: #818cf8;
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.2);
  --yellow: #eab308;
  --red: #ef4444;
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-card: linear-gradient(145deg, #1e2235, #1a1d28);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  margin: 0 -16px;
  padding: 0 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.logo h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.response-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.response-badge span {
  color: var(--accent);
  font-weight: 700;
}

/* Progress Bar */
.progress-container {
  position: sticky;
  top: 81px;
  z-index: 99;
  background: var(--bg-dark);
  margin: 0 -16px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width var(--transition);
  position: relative;
  box-shadow: 0 0 12px var(--accent-glow);
}

.progress-container::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  z-index: -1;
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Sections */
.section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.section.active {
  display: block;
}

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

.section-header {
  margin: 32px 0 24px;
  padding: 24px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.section-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.section-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Question Cards */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.question-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.question-card.answered {
  border-color: rgba(34, 197, 94, 0.3);
}

.question-card.error {
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.question-label {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
  display: flex;
  gap: 8px;
}

.question-number {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.question-text {
  color: var(--text-primary);
}

.required-mark {
  color: var(--red);
  margin-left: 2px;
}

/* Text input */
.text-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.text-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.text-input::placeholder {
  color: var(--text-muted);
}

/* Radio options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.option-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.3);
}

.option-item.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent);
}

.option-item input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 1px;
  position: relative;
}

.option-item input[type="radio"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.option-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

.option-label {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  flex: 1;
}

/* Scale (1-5) */
.scale-container {
  display: flex;
  gap: 8px;
  justify-content: stretch;
}

.scale-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.scale-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.3);
}

.scale-item.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
}

.scale-item input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.scale-item input[type="radio"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.scale-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

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

.scale-endpoints {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
}

.scale-endpoints span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Navigation Buttons */
.nav-buttons {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
  margin-left: auto;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-submit {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 4px 12px var(--green-glow);
  margin-left: auto;
  padding: 14px 36px;
  font-size: 16px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--green-glow);
}

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

/* Success / Error screens */
.success-screen, .error-screen {
  text-align: center;
  padding: 80px 20px;
}

.success-icon, .error-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.success-screen h2, .error-screen h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.success-screen p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 400px;
  margin: 0 auto 8px;
}

.success-note {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.error-screen p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Optional badge */
.optional-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--red);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-md);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
  .app-container {
    padding: 0 12px 60px;
  }

  .header {
    margin: 0 -12px;
    padding: 0 12px;
  }

  .progress-container {
    margin: 0 -12px;
    padding: 8px 12px;
  }

  .logo h1 {
    font-size: 16px;
  }

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

  .question-card {
    padding: 18px;
  }

  .scale-container {
    gap: 4px;
  }

  .scale-item {
    padding: 10px 4px;
  }

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