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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #fafafa;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

main {
  width: 100%;
  max-width: 600px;
}

.survey-container {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
}

h1 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #111;
}

.subtitle {
  color: #666;
  margin-bottom: 2rem;
  font-size: 1.0625rem;
}

/* Question display */

.question-number {
  font-size: 0.8125rem;
  color: #999;
  margin-bottom: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.question-text {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.4;
  color: #111;
}

/* Radio/checkbox options */

.options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

.option {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.option:hover {
  border-color: #bbb;
  background: #fafafa;
}

.option input[type="radio"],
.option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  margin-right: 0.875rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
  position: relative;
}

.option input[type="radio"] {
  border-radius: 50%;
}

.option input[type="checkbox"] {
  border-radius: 5px;
}

.option input[type="radio"]:checked,
.option input[type="checkbox"]:checked {
  border-color: #2563eb;
  background: #2563eb;
}

.option 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 input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.option:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
}

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

/* Survey text inputs */

.text-input-group {
  margin-bottom: 2rem;
}

.survey-text-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.survey-text-input:focus {
  border-color: #2563eb;
}

.survey-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
}

.survey-textarea:focus {
  border-color: #2563eb;
}

.validation-hint {
  font-size: 0.8125rem;
  color: #999;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Progress bar */

.progress-bar {
  height: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

/* Forms */

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #444;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.form-group input[type="text"]:focus {
  border-color: #2563eb;
}

/* Alerts */

.alert {
  padding: 0.875rem 1.125rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Layout helpers */

.actions {
  display: flex;
  gap: 0.75rem;
}

.actions .btn-primary {
  margin-left: auto;
}

.optional-hint {
  font-size: 0.8125rem;
  color: #999;
  margin-bottom: 1rem;
  font-style: italic;
}

/* Thank you page */

.thank-you {
  text-align: center;
  padding: 1.5rem 0;
}

.thank-you h1 {
  margin-bottom: 1rem;
}

.thank-you p {
  color: #555;
  line-height: 1.7;
  font-size: 1.0625rem;
}

.checkmark {
  width: 64px;
  height: 64px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  font-size: 1.75rem;
  line-height: 1;
}

/* Webhook status */

.status-pending {
  background: #f59e0b;
}

.status-failed {
  background: #ef4444;
}

.webhook-status {
  margin-top: 1rem;
  font-weight: 500;
}

.webhook-status-error {
  color: #991b1b;
}

/* Brand header */

.brand-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.brand-header .brand-name {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2563eb;
}

/* Error page */

.error-container {
  text-align: center;
}

.error-container .alert {
  text-align: left;
}

.error-container .btn {
  margin-top: 0.5rem;
}

/* Responsive */

@media (max-width: 640px) {
  .survey-container {
    padding: 1.5rem;
    border-radius: 12px;
  }

  .question-text {
    font-size: 1.25rem;
  }
}
