[hidden] {
  display: none !important;
}

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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #64748b;
  --secondary-hover: #475569;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 5px 10px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 150ms ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1rem;
}

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

label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

input[type="email"],
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--card-bg);
}

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

input::placeholder {
  color: #94a3b8;
}

input.error {
  border-color: var(--error);
}

.error-message {
  display: block;
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 6px;
  min-height: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
  width: 100%;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--secondary-hover);
}

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

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-sm {
  width: auto;
  min-width: 0;
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-loader {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.result, .error, .confirmation {
  text-align: center;
  padding: 24px 0;
}

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

.result h2, .error h2, .confirmation h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.result p, .error p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.dev-link {
  margin-top: 24px;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  text-align: left;
}

.dev-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.magic-link {
  display: block;
  word-break: break-all;
  color: var(--primary);
  font-family: monospace;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

footer {
  text-align: center;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.questionnaire-container {
  max-width: 800px;
}

.questionnaire-header {
  text-align: center;
  margin-bottom: 32px;
}

.header-text h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.header-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.question-step {
  animation: fadeIn 200ms ease;
}

.question-step.has-error {
  border: 1.5px solid var(--error);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: #fef2f2;
}

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

.question-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: default;
}

.question-title {
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.info-icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--secondary);
  background: none;
  border: none;
  padding: 2px 4px;
  margin-top: 2px;
  cursor: help;
  transition: color var(--transition);
}

.info-icon:hover {
  color: var(--primary);
}

.info-card {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-width: 560px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  animation: fadeIn 150ms ease;
}

.info-card p {
  margin: 0;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
  background: var(--card-bg);
}

.option-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.option-card.exclusive:has(input:checked) ~ .option-card:not(.exclusive) {
  opacity: 0.5;
  pointer-events: none;
}

.option-card input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.option-card.radio-style input {
  width: 20px;
  height: 20px;
}

.option-text {
  font-size: 0.95rem;
  line-height: 1.4;
}

.other-input {
  padding: 16px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  margin-bottom: 8px;
  animation: slideDown 200ms ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.other-input label {
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text);
}

.other-input input {
  padding: 10px 12px;
}

.form-navigation {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.form-navigation .btn {
  width: auto;
  min-width: 220px;
}

.confirmation p {
  margin-bottom: 8px;
}

.questionnaire-container.success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.admin-container {
  max-width: 1200px;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: 1.5rem;
}

.admin-header p {
  color: var(--text-muted);
}

.stats-bar {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.admin-message {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
}

.admin-message.visible {
  display: block;
}

.admin-message.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid var(--success);
}

.admin-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid var(--error);
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.tab-panel {
  animation: fadeIn 200ms ease;
}

.report-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.report-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.chart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.chart-bar-label {
  width: 200px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  flex: 1;
  height: 28px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 500ms ease;
  min-width: 0;
}

.chart-bar-value {
  width: 80px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.other-responses {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.other-responses h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.other-item {
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.other-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.other-item-text {
  font-style: italic;
  color: var(--text);
}

.table-container {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg);
}

.answers-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .container {
    padding: 16px 12px;
  }
  
  .card {
    padding: 24px 16px;
  }
  
  .options-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-bar-label {
    width: 120px;
    font-size: 0.8rem;
  }
  
  .chart-bar-value {
    width: 60px;
  }
  
  .form-navigation {
    flex-direction: column-reverse;
  }
  
  .form-navigation .btn {
    width: 100%;
  }
  
  .stats-bar {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .question-title { font-size: 1rem; }
  .option-text { font-size: 0.9rem; }
}