/* Hub & Meet — "Sunrise Amber" design system (ui-ux-pro-max)
   Style: exaggerated minimalism — oversized type, high contrast, warm light. */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;900&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --color-primary: #F59E0B;
  --color-on-primary: #0F172A;
  --color-secondary: #FBBF24;
  --color-accent: #2563EB;
  --color-background: #FFFBEB;
  --color-foreground: #78350F;
  --color-ink: #431407;
  --color-muted: #F1F2EF;
  --color-border: #FDE68A;
  --color-surface: #FFFFFF;
  --color-destructive: #DC2626;
  --color-ring: #F59E0B;
  --color-ok: #15803D;
  --color-warn: #B45309;

  --font-heading: 'Outfit', system-ui, sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgb(120 53 15 / 0.06), 0 10px 28px -12px rgb(120 53 15 / 0.18);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-foreground);
  line-height: 1.1;
  margin: 0 0 var(--space-2);
}

h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 900; letter-spacing: -0.03em; }
h2:focus, h1:focus { outline: none; }

a { color: var(--color-accent); }

main {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--space-3) var(--space-5);
}

/* ---------- header / footer ---------- */

.site-header {
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.lang-switch {
  display: inline-flex;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 3px;
  background: var(--color-surface);
}

.lang-switch button {
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--color-foreground);
  padding: 0.35rem 0.7rem;
  min-height: 32px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switch button:hover { background: rgb(253 230 138 / 0.4); }

.lang-switch button.is-active {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.lang-switch button:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 1px;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--color-foreground);
}

.logo em {
  font-style: normal;
  color: var(--color-primary);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-3);
  font-size: 0.82rem;
  color: var(--color-foreground);
  text-align: center;
}

/* ---------- screens ---------- */

.screen[hidden] { display: none; }

.screen-hero {
  padding-top: clamp(2rem, 8vh, 6rem);
  text-align: left;
}

.hero-title {
  font-size: clamp(2.9rem, 9.5vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.98;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.hero-line { display: block; }

.hero-line-accent { color: var(--color-primary); }

.hero-sub {
  max-width: 34rem;
  font-size: 1.12rem;
  margin: 0 0 var(--space-4);
  color: var(--color-foreground);
}

.hero-note {
  margin-top: var(--space-4);
  font-size: 0.85rem;
  color: var(--color-warn);
}

.screen-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(var(--space-3), 5vw, var(--space-4));
  margin-top: var(--space-3);
}

.screen-sub {
  margin: -0.5rem 0 var(--space-3);
  color: var(--color-warn);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.btn-primary:hover:not(:disabled) { background: #E08D00; }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-foreground);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-muted); }

.btn-ghost {
  background: transparent;
  color: var(--color-foreground);
}
.btn-ghost:hover:not(:disabled) { background: rgb(253 230 138 / 0.35); }

.btn-lg { font-size: 1.15rem; padding: 0.9rem 1.8rem; }

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 3px solid rgb(15 23 42 / 0.25);
  border-top-color: var(--color-on-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn-spinner { display: inline-block; }
.btn.is-loading .btn-arrow { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- form fields ---------- */

.field { margin-bottom: var(--space-3); }

.field > label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.helper {
  font-size: 0.85rem;
  color: var(--color-warn);
  margin: 0.4rem 0 0;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.text-input {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  font: inherit;
  color: var(--color-ink);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.text-input::placeholder { color: #A8825A; }

/* ---------- combobox ---------- */

.combo-input-wrap { position: relative; }

.combo-input {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  font: inherit;
  color: var(--color-ink);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.combo-input::placeholder { color: #A8825A; }

.combo-list {
  position: absolute;
  z-index: 20;
  inset-inline: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  max-height: 310px;
  overflow-y: auto;
}

.combo-option {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  min-height: 44px;
  justify-content: center;
}

.combo-option.is-active { background: rgb(253 230 138 / 0.45); }

.combo-option-label { font-weight: 500; }

.combo-option-sub { font-size: 0.8rem; color: var(--color-warn); }

.combo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgb(253 230 138 / 0.5);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.25rem 0.4rem 0.25rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-foreground);
  cursor: pointer;
}

.chip-remove:hover { background: var(--color-border); }

/* ---------- crew ---------- */

.crew-list {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

.crew-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-2);
  padding: 0.8rem 1rem;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.crew-who { display: flex; flex-direction: column; min-width: 0; }

.crew-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px dashed transparent;
  border-radius: 0;
  padding: 0.1rem 0;
  min-height: 32px;
  width: 100%;
  cursor: text;
}

.crew-name:hover { border-bottom-color: var(--color-border); }

.crew-name:focus {
  outline: none;
  border-bottom-color: var(--color-primary);
}

.crew-who span { font-size: 0.9rem; color: var(--color-warn); }

.crew-passports {
  font-size: 0.85rem;
  color: var(--color-foreground);
  text-align: right;
}

.crew-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-destructive);
  cursor: pointer;
}

.crew-remove:hover { background: rgb(220 38 38 / 0.08); }

/* ---------- results ---------- */

.results-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.results-top-actions {
  display: flex;
  gap: var(--space-1);
}

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: 0.8rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-2);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
}

/* The checkbox itself is drawn as the switch track — no hidden inputs,
   so the control can never overlap the label text. */
.toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 24px;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  border: none;
  border-radius: 999px;
  background: #E7E5E4;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.toggle input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition: transform 0.2s ease;
}

.toggle input:checked { background: var(--color-primary); }
.toggle input:checked::after { transform: translateX(18px); }
.toggle input:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

.check-nearby {
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

.visa-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  min-height: 44px;
}

.visa-filter select {
  font: inherit;
  min-height: 40px;
  padding: 0.3rem 0.6rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
}

.results-summary {
  font-size: 0.9rem;
  color: var(--color-warn);
  margin: 0 0 var(--space-2);
}

.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  counter-reset: rank;
}

.result-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-2) var(--space-3);
}

.result-rank {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--color-secondary);
  min-width: 2rem;
  grid-row: span 2;
  padding-top: 0.15rem;
}

.result-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
}

.result-city {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
}

.result-country { color: var(--color-warn); font-size: 0.95rem; }

.result-total {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.result-legs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  grid-column: 2;
}

.result-legs li {
  display: grid;
  grid-template-columns: minmax(4.2rem, 9rem) 1fr auto auto auto;
  gap: 0.7rem;
  align-items: center;
  font-size: 0.92rem;
  border-top: 1px dashed var(--color-border);
  padding-top: 0.35rem;
}

.leg-who {
  font-weight: 600;
  color: var(--color-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leg-tickets {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  min-height: 24px;
}

.leg-tickets:hover { text-decoration: underline; }

.leg-route { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.leg-dist {
  color: var(--color-warn);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  justify-self: end;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-free { background: rgb(21 128 61 / 0.12); color: var(--color-ok); }
.badge-eta { background: rgb(37 99 235 / 0.1); color: var(--color-accent); }
.badge-soft { background: rgb(245 158 11 / 0.18); color: var(--color-warn); }
.badge-hard { background: rgb(220 38 38 / 0.1); color: var(--color-destructive); }
.badge-block { background: #431407; color: #FFF7ED; }
.badge-unknown { background: var(--color-muted); color: #57534E; }

.results-empty {
  text-align: center;
  padding: var(--space-4) var(--space-2);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

.btn-more {
  margin: var(--space-3) auto 0;
  display: flex;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .result-card {
    grid-template-columns: 1fr;
    padding: var(--space-2);
  }
  .result-rank { grid-row: 1; min-width: 0; }
  .result-head, .result-legs { grid-column: 1; min-width: 0; }
  .result-total { margin-left: 0; width: 100%; }
  .result-legs li {
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.7rem;
  }
  .leg-who { grid-column: 1; grid-row: 1; }
  .leg-dist { grid-column: 2; grid-row: 1; }
  .leg-route { grid-column: 1; grid-row: 2; }
  .badge { grid-column: 2; grid-row: 2; }
  .leg-tickets { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
  .crew-card { grid-template-columns: 1fr auto; }
  .crew-passports { grid-column: 1; text-align: left; }
  .crew-remove { grid-column: 2; grid-row: 1; }
  .step-actions { flex-direction: column-reverse; }
  .step-actions .btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
