:root {
  --color-bg: #f6f7f9;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-accent: #0ea5e9;
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.02);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.container-narrow {
  max-width: 520px;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

h1, h2, h3 {
  margin: 0 0 16px 0;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

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

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

.logo h1 {
  font-size: 2.25rem;
  margin-bottom: 4px;
}

.logo p {
  color: var(--color-muted);
  margin: 0;
  font-weight: 500;
}

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

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

.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.checkbox-item:hover,
.radio-item:hover {
  background: #f9fafb;
}

.checkbox-item input,
.radio-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.checkbox-item.checked,
.radio-item.checked {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

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

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

.btn-secondary {
  background: white;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

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

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 1.125rem;
}

.btn-block {
  width: 100%;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-error {
  background: #fef2f2;
  color: var(--color-danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.alert-info {
  background: #eff6ff;
  color: var(--color-primary-dark);
  border: 1px solid #bfdbfe;
}

.hidden {
  display: none !important;
}

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

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* Header challenge */
.challenge-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  box-shadow: var(--shadow);
}

.challenge-header .inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.challenge-header .company {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.challenge-header .mission-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.challenge-header .timer {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-danger);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

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

.mission-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.mission-stepper {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.step {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  background: #f3f4f6;
}

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

.step.completed {
  background: var(--color-success);
  color: white;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone.dragover {
  border-color: var(--color-primary);
  background: #eff6ff;
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.dropzone-text {
  color: var(--color-muted);
  font-weight: 500;
}

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

.preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.preview-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.save-status {
  font-size: 0.85rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.save-status.saving { color: var(--color-warning); }
.save-status.saved { color: var(--color-success); }

/* Summary */
.summary-grid {
  display: grid;
  gap: 16px;
}

.summary-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid var(--color-primary);
}

.summary-card h4 {
  margin: 0 0 6px 0;
  color: var(--color-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-card p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.summary-capture {
  display: inline-block;
  max-width: 320px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.summary-capture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 16px;
  }

  .card {
    padding: 24px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .challenge-header .inner {
    padding: 0 16px;
  }

  .mission-nav {
    flex-direction: column;
  }

  .mission-nav .btn {
    width: 100%;
  }
}
