/* Pilot intake form. Tokens, reset, breadcrumb come from /assets/css/. */

body {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--ink-0);
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.pilot-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--s-8) var(--page-pad-x) var(--s-12);
  width: 100%;
}

/* Hero block */
.hero {
  width: 100%;
  max-width: 560px;
  margin: 0 0 var(--s-6);
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-3);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  margin-bottom: var(--s-3);
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
}

h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--s-2);
  line-height: var(--lh-snug);
  letter-spacing: -0.02em;
}

.hero-sub {
  color: var(--text-3);
  font-size: var(--fs-body);
}

/* Progress dots */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  margin: var(--s-5) 0;
  width: 100%;
  max-width: 560px;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-2);
  transition: background var(--t-base), box-shadow var(--t-base);
}

.progress-dots .dot.is-active,
.progress-dots .dot.is-done {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 149, 0, 0.5);
}

/* Form */
form#pilotForm {
  width: 100%;
  max-width: 560px;
}

.panels {
  position: relative;
  min-height: 360px;
}

.step {
  opacity: 0;
  visibility: hidden;
  transform: translateX(40px);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  pointer-events: none;
}

.step.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  position: relative;
  pointer-events: auto;
}

.step-copy {
  color: var(--text-1);
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 500;
  margin-bottom: var(--s-2);
  line-height: var(--lh-snug);
}

.step-sub {
  color: var(--text-3);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  margin-bottom: var(--s-5);
}

.field {
  margin-bottom: var(--s-4);
}

.field:last-of-type {
  margin-bottom: 0;
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  background: var(--ink-1);
  color: var(--text-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5);
  font-size: var(--fs-body);
  font-family: var(--font-mono);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  min-height: 54px;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: var(--lh-body);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-4);
  font-family: var(--font-mono);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.14);
}

/* Select */
.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  pointer-events: none;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-image: none;
}

.field select option {
  background: var(--ink-0);
  color: var(--text-1);
}

.char-counter {
  display: block;
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-4);
  margin-top: var(--s-2);
  letter-spacing: var(--tracking-caps);
}

.char-counter.is-near {
  color: var(--amber);
}

.field-error {
  display: none;
  margin-top: var(--s-2);
  color: #ff6b6b;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
}

.field-error.is-visible {
  display: block;
}

/* Nav */
.nav-row {
  margin-top: var(--s-6);
  display: flex;
  gap: var(--s-4);
  align-items: center;
  flex-wrap: wrap;
}

.nav-row .spacer {
  flex: 1;
}

button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amber);
  color: var(--ink-0);
  border: none;
  padding: 0 var(--s-8);
  height: 52px;
  font-size: var(--fs-body);
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: var(--tracking-tight);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}

button.primary:hover:not(:disabled) {
  background: #FFA733;
}

button.primary:active:not(:disabled) {
  transform: translateY(1px);
}

button.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-3);
  border: 1px solid var(--line-2);
  padding: 0 var(--s-6);
  height: 52px;
  font-size: var(--fs-body);
  font-family: var(--font-sans);
  font-weight: 500;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}

button.ghost:hover {
  color: var(--text-1);
  border-color: var(--line-1);
}

/* Confirmation receipt */
.receipt {
  width: 100%;
  margin: var(--s-5) 0 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  background: var(--ink-1);
  padding: var(--s-8) var(--s-7) var(--s-7);
  font-family: var(--font-mono);
  color: var(--text-2);
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.receipt.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.receipt::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
}

.receipt-seal {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--s-3);
}

.receipt-seal svg {
  width: 28px;
  height: 28px;
  color: var(--amber);
}

.receipt-divider {
  color: var(--line-1);
  letter-spacing: 0.05em;
  font-size: 0.65rem;
  line-height: 1.4;
  text-align: center;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}

.receipt-title {
  text-align: center;
  color: var(--text-1);
  font-weight: 600;
  font-size: var(--fs-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: var(--s-3) 0;
}

.receipt-fields {
  padding: var(--s-4) var(--s-2);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.receipt-row {
  display: flex;
  gap: var(--s-3);
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.5;
  word-break: break-word;
}

.receipt-row .k {
  color: var(--text-4);
  flex: 0 0 140px;
}

.receipt-row .v {
  color: var(--text-2);
}

.receipt-row .v.status {
  color: var(--amber);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.receipt-message {
  padding: var(--s-4) var(--s-2) var(--s-2);
  color: var(--text-3);
  font-size: 0.875rem;
  line-height: var(--lh-body);
  text-align: center;
}

.receipt-back {
  text-align: center;
  margin-top: var(--s-6);
}

.receipt-back a {
  color: var(--text-3);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--tracking-caps);
  transition: color var(--t-fast);
}

.receipt-back a:hover {
  color: var(--text-1);
}

.submit-error {
  display: none;
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid rgba(255, 77, 77, 0.4);
  background: rgba(255, 77, 77, 0.06);
  color: #ff8080;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  border-radius: var(--r-2);
}

.submit-error.is-visible {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .step { transition: none; }
  button.primary, button.ghost { transition: none; }
  .receipt { transition: none; }
}

@media (max-width: 480px) {
  .pilot-shell { padding: var(--s-6) var(--page-pad-x) var(--s-10); }
  button.primary { width: 100%; }
  button.ghost { width: 100%; }
  .nav-row { flex-direction: column-reverse; align-items: stretch; }
  .nav-row .spacer { display: none; }
  .receipt { padding: var(--s-6) var(--s-5) var(--s-5); }
  .receipt-row { flex-direction: column; gap: var(--s-1); }
  .receipt-row .k { flex-basis: auto; }
  .receipt-divider { font-size: 0.55rem; }
  .panels { min-height: 320px; }
}
