:root {
  --primary: #0078d4;
  --primary-dark: #005a9e;
  --success: #107c10;
  --error: #a4262c;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #201f1e;
  --muted: #605e5c;
  --border: #edebe9;
  --radius: 8px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

#app { display: flex; flex-direction: column; min-height: 100vh; }

.screen { display: flex; flex-direction: column; min-height: 100vh; }
.screen.hidden { display: none; }

/* Auth check */
#auth-check { align-items: center; justify-content: center; gap: 16px; color: var(--muted); }

/* Header */
.site-header {
  background: #1a1a2e;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 600;
}
.site-logo { height: 28px; width: auto; }
.header-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.25); }
.user-badge {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 400;
  background: rgba(255,255,255,0.12);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Card */
.card {
  max-width: 700px;
  width: 100%;
  margin: 32px auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card-center { text-align: center; margin-top: 10vh; }

/* Intro */
.survey-intro { margin-bottom: 32px; }
h1 { font-size: 1.5rem; margin-bottom: 10px; }
.subtitle { color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.notice {
  background: #eff6fc;
  border: 1px solid #c7e0f4;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #004578;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Questions */
.question {
  margin-bottom: 24px;
  padding: 20px;
  background: #faf9f8;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.question-label {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 8px;
  line-height: 1.5;
}
.question-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.required-star { color: var(--error); margin-left: 2px; }
fieldset { border: none; }
legend.question-label { float: left; width: 100%; margin-bottom: 8px; }

/* Checkbox & radio lists */
.checkbox-group, .radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  clear: both;
}
.check-item, .radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: border-color 0.15s, background 0.15s;
}
.check-item:hover, .radio-item:hover {
  border-color: var(--primary);
  background: #f0f6fc;
}
.check-item input, .radio-item input { flex-shrink: 0; accent-color: var(--primary); width: 16px; height: 16px; }

/* Textarea */
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  margin-top: 8px;
  transition: border-color 0.15s;
  background: #fff;
}
textarea:focus { outline: none; border-color: var(--primary); }

/* Errors */
.field-error { margin-top: 8px; font-size: 0.85rem; color: var(--error); }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: #fde7e9; color: var(--error); border: 1px solid #f1b2b5; }
.hidden { display: none !important; }

/* Button */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
  margin-top: 8px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #a0a0a0; cursor: not-allowed; }

/* Spinners */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Thank you / error */
.success-icon, .error-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 24px;
  color: #fff;
}
.success-icon { background: var(--success); }
.error-icon { background: var(--error); }
.card-center h1 { margin-bottom: 12px; }
.card-center p { color: var(--muted); margin-bottom: 8px; line-height: 1.6; }
.muted { color: var(--muted) !important; font-size: 0.85rem !important; }

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

@media (max-width: 600px) {
  .card { margin: 16px; padding: 24px 20px; }
}
