:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-soft: #eef2ff;
  --green: #16a34a;
  --green-soft: #ecfdf5;
  --orange: #ea580c;
  --orange-soft: #fff7ed;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #ec4899 100%);
  color: white;
  padding: 56px 20px 80px;
}
.hero-inner { max-width: 880px; margin: 0 auto; }
.brand { font-weight: 700; letter-spacing: .04em; opacity: .85; font-size: 13px; text-transform: uppercase; }
.hero h1 { margin: 14px 0 12px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; font-weight: 700; }
.hero h1 .accent { color: #fcd34d; }
.lead { max-width: 600px; opacity: .92; font-size: 16px; }

.wizard {
  max-width: 880px;
  margin: -48px auto 40px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px clamp(20px, 4vw, 40px) 32px;
  position: relative;
}

.steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 0;
  margin: 0 0 24px;
  font-size: 12px;
  color: var(--muted);
}
.steps li {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: transparent;
  transition: background .15s, color .15s;
}
.steps li span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: white;
  font-weight: 600;
  font-size: 11px;
}
.steps li.active { color: var(--ink); background: var(--primary-soft); }
.steps li.active span { background: var(--primary); }
.steps li.done span { background: var(--green); }
.steps li.done { color: var(--green); }

.step {
  display: none;
  animation: fadeUp .25s ease;
}
.step.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.hint { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .grid.two { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field span { font-size: 12px; color: var(--muted); font-weight: 500; }
.field.full { grid-column: 1 / -1; }
.field input, .field textarea, .field select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.combo { position: relative; }
.suggest {
  position: absolute;
  top: 100%; left: 0; right: 0;
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow: auto;
  z-index: 5;
  display: none;
}
.suggest.open { display: block; }
.suggest li {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.suggest li:hover, .suggest li.hl { background: var(--primary-soft); }
.suggest .row1 { font-weight: 600; font-size: 14px; }
.suggest .row2 { color: var(--muted); font-size: 12px; }

.flight-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px solid #e0e7ff;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.flight-card.hidden { display: none; }
.fc-side { text-align: center; }
.fc-iata { font-size: 22px; font-weight: 700; }
.fc-name { font-size: 12px; color: var(--muted); }
.fc-sep { color: var(--primary); font-size: 24px; }
.fc-meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.fc-meta strong { color: var(--ink); }

.incident-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 700px) { .incident-cards { grid-template-columns: 1fr; } }
.incident-card {
  position: relative;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: white;
  transition: border-color .15s, background .15s;
  display: flex; gap: 8px; align-items: flex-start;
}
.incident-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.incident-card input { margin-top: 4px; accent-color: var(--primary); }
.incident-card strong { display: block; font-size: 14px; }
.incident-card span { color: var(--muted); font-size: 12px; }

.incident-details { display: grid; gap: 10px; margin-bottom: 14px; }
.incident-details.hidden { display: none; }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }

.actions {
  margin-top: 24px;
  display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap;
}
.actions .primary { margin-left: auto; }
button {
  font: inherit;
  padding: 10px 18px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: filter .15s, transform .05s;
}
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--primary); color: white; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.primary:active { transform: translateY(1px); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.ghost:hover { background: var(--bg); color: var(--ink); }

.verdict {
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
}
.verdict h3 { margin: 0 0 10px; font-size: 20px; }
.verdict .amount { font-size: 38px; font-weight: 700; margin: 4px 0 8px; }
.verdict.likely { background: var(--green-soft); border-color: #bbf7d0; }
.verdict.likely h3, .verdict.likely .amount { color: var(--green); }
.verdict.requires_review { background: var(--orange-soft); border-color: #fed7aa; }
.verdict.requires_review h3, .verdict.requires_review .amount { color: var(--orange); }
.verdict.unlikely { background: var(--red-soft); border-color: #fecaca; }
.verdict.unlikely h3, .verdict.unlikely .amount { color: var(--red); }

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 700px) { .upload-grid { grid-template-columns: 1fr; } }
.upload-zone {
  position: relative;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: white;
  transition: border-color .15s, background .15s;
}
.upload-zone.drag { border-color: var(--primary); background: var(--primary-soft); }
.upload-zone .uz-head { margin-bottom: 8px; }
.upload-zone .uz-head strong { display: block; }
.upload-zone .uz-head span { color: var(--muted); font-size: 12px; }
.upload-zone input[type=file] {
  display: block;
  font-size: 12px;
  width: 100%;
  margin-top: 4px;
}
.upload-zone .files { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12px; display: grid; gap: 4px; }
.upload-zone .files li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  background: var(--bg);
  border-radius: 6px;
}
.upload-zone .files button {
  margin-left: auto;
  padding: 2px 6px;
  font-size: 11px;
  background: transparent;
  color: var(--red);
}
.upload-zone .files .ok { color: var(--green); }

.contract {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  max-height: 220px;
  overflow: auto;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.contract h3 { margin: 0 0 8px; color: var(--ink); }

.done-box { text-align: center; padding: 24px 0; }
.done-box .check-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 50%;
  font-size: 36px;
  font-weight: 700;
}

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 12px 20px 32px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: white;
  padding: 10px 16px; border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: fadeIn .15s ease;
}
.toast.err { background: var(--red); }
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.prefill-hint {
  display: block;
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(28, 77, 220, 0.08);
  color: #1c4ddc;
  border-radius: 6px;
  font-size: 12px;
}
.prefill-hint strong { font-weight: 700; }
