:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --success: #22c55e;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #020817, var(--bg));
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 24px;
}

h1 {
  margin-bottom: 24px;
}

.flight-form {
  background: rgba(17, 24, 39, 0.9);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select {
  margin-top: 6px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
}

button {
  margin-top: 18px;
  border: none;
  background: var(--accent);
  color: #082f49;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.status {
  min-height: 28px;
  margin: 18px 0;
  font-weight: 600;
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--error);
}

.results {
  display: block;
  gap: 20px;
  margin-top: 18px;
}

.results-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.muted-button {
  background: transparent;
  border: 1px solid rgba(148,163,184,0.12);
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.muted-button:hover { filter: brightness(1.05); }

.panel {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 18px;
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #dbeafe;
}

.summary-item {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
}

.summary-item:last-child {
  margin-bottom: 0;
}

.flight-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.title-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.airline-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.airline-logo,
.offer-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.offer-logo {
  width: 22px;
  height: 22px;
}

.route-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 1.1rem;
  flex-wrap: wrap;
}

.route-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.route-label {
  font-weight: 700;
}

.time-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 4px;
}

.route-arrow {
  color: var(--accent);
  font-size: 1.3rem;
}

.route-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.route-link.disabled {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
}

.route-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.connection-wrap {
  display: none;
  margin-top: 8px;
}

.connection-detail {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: rgba(30, 41, 59, 0.8);
  border-radius: 6px;
  line-height: 1.6;
}

.flight-meta {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .results {
    grid-template-columns: 1fr;
  }
}
