:root {
  --void: #f7f9ff;
  --white: #08254B;
  --soft: #08254B;
  --steel: rgba(8, 37, 75, .68);
  --line: rgba(8, 37, 75, .14);
  --line-strong: rgba(8, 37, 75, .34);
  --violet: #7a35c7;
  --blue: #0e5aa7;
  --blue-soft: rgba(14, 90, 167, .08);
  --mist: #08254B;
  --panel: rgba(255, 255, 255, .82);
  --panel-strong: rgba(255, 255, 255, .96);
  --font: Inter, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", Consolas, monospace;
  --radius-card: 19px;
  --radius-control: 8px;
}

* { box-sizing: border-box; }
html { background: var(--void); color: var(--white); font-family: var(--font); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(14, 90, 167, .1), transparent 26rem),
    radial-gradient(circle at 6% 20%, rgba(122, 53, 199, .07), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, #f3f6fc 100%),
    var(--void);
}
body::before {
  content: none;
}
button, input, select, textarea { font: inherit; }
button, a { cursor: pointer; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; }
.hidden { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  max-width: 1200px; margin: 0 auto; padding: 16px clamp(16px, 4vw, 32px);
  background: rgba(255, 255, 255, .74); backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.brand {
  color: var(--white); text-decoration: none; text-transform: uppercase;
  letter-spacing: .18em; font: 500 12px/1 var(--mono);
}
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav button, .outline {
  min-height: 40px; color: var(--white); background: rgba(255, 255, 255, .55);
  border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 9px 15px; text-transform: uppercase; letter-spacing: .07em;
  font: 500 12px/1 var(--mono);
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.nav button:hover, .outline:hover { border-color: var(--violet); color: var(--white); background: rgba(122, 53, 199, .08); }
.outline.danger { border-color: rgba(190, 18, 60, .28); color: #9f1239; }
.outline.danger:hover { border-color: #be123c; background: rgba(244, 63, 94, .08); color: #9f1239; }

main { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px) 80px; }
body.is-authenticated main { padding-top: 24px; }
.hero {
  min-height: calc(100vh - 74px); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 520px;
  align-items: center; gap: clamp(32px, 6vw, 72px); padding: 88px 0 64px;
}
body.is-authenticated .hero { display: none; }
.signal-sky {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(247, 249, 255, .96)),
    radial-gradient(ellipse at 62% 8%, rgba(122, 53, 199, .13), transparent 34rem);
}
.terminal-grid {
  display: none;
}
.hero-copy { position: relative; z-index: 2; }
.hero h1 {
  margin: 0; max-width: 780px; font-weight: 300; font-size: clamp(56px, 9vw, 104px);
  line-height: .92; letter-spacing: 0; color: var(--white);
}
.hero h1 span { font-style: italic; color: var(--white); text-shadow: 0 16px 44px rgba(8,37,75,.12); }
.hero p:not(.eyebrow) { width: min(560px, 100%); margin: 28px 0 0; color: var(--steel); font-size: 20px; line-height: 1.55; font-weight: 300; }
.eyebrow, .pass-label {
  color: var(--soft); text-transform: uppercase; letter-spacing: .18em;
  font: 400 11px/1.4 var(--mono); margin: 0 0 18px;
}

.boarding-pass {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  position: relative; overflow: hidden;
}
.boarding-pass::after {
  content: none;
}
.pass-route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; color: var(--steel); font: 500 12px/1 var(--mono); letter-spacing: .12em; }
.pass-route i { height: 1px; background: var(--line); position: relative; }
.pass-route i::after { content: ""; position: absolute; right: 0; top: -4px; width: 9px; height: 9px; border-radius: 99px; background: var(--violet); box-shadow: 0 0 28px rgba(122,53,199,.28); }
.pass-title { margin-top: 42px; max-width: 270px; font-size: 32px; line-height: 1.1; font-weight: 300; }
.pass-code { position: absolute; right: 30px; bottom: 34px; display: flex; gap: 5px; align-items: end; height: 92px; }
.pass-code span { width: 4px; background: rgba(8,37,75,.46); }
.pass-code span:nth-child(2n) { height: 68%; }
.pass-code span:nth-child(3n) { height: 42%; }
.pass-code span:nth-child(4n) { height: 86%; }
.pass-code span:nth-child(5n) { height: 54%; }

.auth-shell { display: grid; place-items: center; margin: 0; position: relative; z-index: 5; }
.auth-card { width: min(100%, 520px); padding: 28px; box-shadow: none; }
.auth-card .pass-label { margin-bottom: 18px; }
.auth-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 28px;
  padding-bottom: 0; border-bottom: 0;
}
.auth-tabs button {
  min-height: 44px; border: 1px solid transparent; border-radius: var(--radius-control);
  background: transparent; color: var(--steel); text-transform: uppercase; letter-spacing: .07em;
  font: 500 11px/1 var(--mono); transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.auth-tabs button[aria-selected="true"] { color: var(--white); border-color: var(--line-strong); background: rgba(122,53,199,.08); }
.auth-form { border: 0; border-radius: 0; padding: 0; background: transparent; }
.auth-form h2 { margin: 0 0 12px; font-size: clamp(32px, 5vw, 48px); line-height: 1.05; font-weight: 300; }
.form-lead { margin: 0 0 24px; color: var(--steel); line-height: 1.5; }
.auth-form label + label, .auth-form label + button, .auth-form textarea + button { margin-top: 16px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: clamp(24px, 4vw, 40px); margin-bottom: 40px;
  box-shadow: 0 22px 70px rgba(8, 37, 75, .07);
}
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 28px; }
h2, h3 { font-weight: 300; margin: 0 0 20px; line-height: 1.13; letter-spacing: 0; }
h2 { font-size: clamp(32px, 4vw, 54px); }
h3 { font-size: 28px; }
.draw-grid, .split { display: grid; grid-template-columns: minmax(320px, 1fr) 260px; gap: 20px; }
.split { grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr); margin-top: 32px; }
.form, .details, .list-item { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; background: rgba(255,255,255,.68); }
label, .label { display: grid; gap: 8px; color: var(--steel); font-size: 14px; line-height: 1.4; }
input, select, textarea {
  width: 100%; min-height: 46px; color: var(--white); background: rgba(255,255,255,.9);
  border: 1px solid var(--line); border-radius: var(--radius-control); padding: 11px 13px;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); }
textarea { min-height: 92px; resize: vertical; }
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-radius: 5px;
  accent-color: var(--white);
}
button[type="submit"], .primary {
  min-height: 46px; border: 1px solid var(--white); color: #ffffff;
  background: var(--white);
  padding: 12px 18px; border-radius: var(--radius-control); text-transform: uppercase;
  letter-spacing: .07em; font: 500 12px/1 var(--mono);
}
.wide { grid-column: 1 / -1; }
.check-list, .rows, .list { display: grid; gap: 12px; }
.check-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}
.check-row strong {
  font-weight: 500;
  color: var(--white);
}
.check-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--steel);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}
.category-row, .inline-form { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: end; }
.category-row { grid-template-columns: minmax(260px, 1fr) 180px auto; }
.inline-form { grid-template-columns: 1fr 160px 180px auto; margin-bottom: 20px; }
.list-item { display: grid; gap: 8px; }
.meta { color: var(--steel); font-size: 14px; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.launch-panel {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(8, 37, 75, .2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(14, 90, 167, .08), rgba(255,255,255,.72));
}
.launch-button {
  min-height: 58px;
  width: 100%;
  border: 1px solid #08254B;
  border-radius: var(--radius-control);
  color: #ffffff;
  background: #08254B;
  text-transform: uppercase;
  letter-spacing: .08em;
  font: 700 13px/1 var(--mono);
  box-shadow: 0 14px 30px rgba(8, 37, 75, .18);
}
.launch-button:hover { background: #0e356a; }
.launch-button:disabled {
  cursor: default;
  opacity: .46;
  box-shadow: none;
}
.template-order { display: grid; gap: 10px; margin-top: 18px; }
.field-order { display: grid; gap: 8px; }
.order-row {
  display: grid;
  grid-template-columns: 32px minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
}
.order-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--white);
  font: 600 12px/1 var(--mono);
}
.order-row strong { font-weight: 500; }
.order-actions { display: flex; gap: 6px; }
.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--white);
  background: rgba(255,255,255,.86);
  font: 600 16px/1 var(--font);
}
.icon-button:disabled {
  cursor: default;
  opacity: .38;
}
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-control);
  background: #ffffff; color: var(--white); opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
#toast.show { opacity: 1; }

@media (max-width: 920px) {
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 28px; padding: 42px 0 56px; }
  .hero h1 { font-size: clamp(48px, 10vw, 76px); }
  .hero p:not(.eyebrow) { margin-top: 18px; font-size: 18px; }
  .auth-shell { margin-top: 0; }
  .draw-grid, .split, .inline-form, .check-row, .category-row { grid-template-columns: 1fr; }
  .order-row { grid-template-columns: 32px minmax(0, 1fr); }
  .order-actions { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .topbar { align-items: start; flex-direction: column; }
  .auth-tabs { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: 42px; }
  .auth-card { padding: 20px; }
  .auth-form h2 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
