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

:root {
  --bg: #f8f8f8;
  --surface: #fff;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #ddd;
  --accent: #2a5bd7;
  --accent-hover: #1e45a8;
  --danger: #c0392b;
  --danger-bg: #fdf0ef;
  --success: #27ae60;
  --warning: #e67e22;
  --warning-bg: #fef6ec;
  --code-bg: #f0f0f0;
}

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

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

p.subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 24px;
}

/* Form elements */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

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

/* Buttons */
button, .btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}

button:hover, .btn:hover {
  background: var(--bg);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button.primary:disabled {
  background: var(--accent);
  border-color: var(--accent);
}

button.media-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  padding: 12px 20px;
  border: 2px dashed var(--border);
  background: var(--bg);
  width: 100%;
  justify-content: center;
}

button.media-btn.enabled {
  border-color: var(--success);
  border-style: solid;
  color: var(--success);
}

/* Camera preview */
.camera-preview {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4/3;
  background: #111;
  margin: 16px auto;
  display: block;
}

.camera-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Notices */
.notice {
  padding: 12px 16px;
  border-left: 3px solid var(--warning);
  background: var(--warning-bg);
  font-size: 0.85rem;
  margin: 16px 0;
}

.notice.danger {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}

.flag-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--danger);
  border: 1px solid var(--danger);
  margin-left: 8px;
  vertical-align: middle;
}

/* Progress */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-track {
  flex: 1;
  height: 3px;
  background: var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

/* Question display */
.question-text {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.follow-up-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.follow-up-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

/* Screens */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Recording indicator */
.rec-indicator {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 100;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e74c3c;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Completion screen */
.completion-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

/* Error message */
.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 8px;
}

/* Row layout */
.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

/* Navigation */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

/* Responsive */
@media (max-width: 500px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .container {
    padding: 24px 16px;
  }

  .card {
    padding: 20px;
  }
}
