/* Start a Pilot onboarding page */

.pilot-section {
  background: var(--gray-50, #f8fafc);
}

.pilot-container {
  max-width: 860px;
}

.pilot-container-narrow {
  max-width: 520px;
}

/* "How a pilot works" steps on the public enquiry page */
.pilot-howitworks {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pilot-how-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.pilot-how-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-navy, #000080);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.pilot-how-step h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: var(--primary-navy, #000080);
}

.pilot-how-step p {
  margin: 0;
  color: var(--gray-600, #475569);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Quieter card for the "already have a code" prompt */
.pilot-card-quiet {
  background: var(--gray-50, #f8fafc);
}

.pilot-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

/* Step chips */
.pilot-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  counter-reset: none;
}

.pilot-step-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600, #475569);
}

.pilot-step-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gray-200, #e2e8f0);
  color: var(--gray-700, #334155);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.pilot-step-chip.is-complete {
  border-color: #16a34a;
  color: #15803d;
}

.pilot-step-chip.is-complete span {
  background: #16a34a;
  color: #fff;
  font-size: 0;
}

.pilot-step-chip.is-complete span::before {
  content: "\2713";
  font-size: 0.75rem;
}

/* Notices */
.pilot-notice {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-left: 4px solid var(--primary-navy, #000080);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--gray-700, #334155);
}

.pilot-notice strong {
  color: var(--primary-navy, #000080);
  display: block;
  margin-bottom: 0.25rem;
}

.pilot-notice-amber {
  background: #fffbeb;
  border-color: #fcd34d;
  border-left-color: #d97706;
}

.pilot-notice-amber strong {
  color: #92400e;
}

/* Cards */
.pilot-card {
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.pilot-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-navy, #000080);
  padding: 0;
  margin-bottom: 0.35rem;
}

.pilot-card-sub {
  color: var(--gray-600, #475569);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.pilot-subhead {
  font-size: 1rem;
  color: var(--primary-navy, #000080);
  margin: 1.75rem 0 1rem;
}

/* Fields */
.pilot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}

.pilot-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.pilot-field {
  margin-bottom: 1.15rem;
  min-width: 0;
}

.pilot-grid .pilot-field {
  margin-bottom: 0;
}

.pilot-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700, #334155);
  margin-bottom: 0.4rem;
}

.pilot-field .req {
  color: #dc2626;
}

.pilot-field input,
.pilot-field select,
.pilot-field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white, #fff);
  color: var(--gray-700, #334155);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pilot-field textarea {
  resize: vertical;
}

.pilot-field input:focus,
.pilot-field select:focus,
.pilot-field textarea:focus {
  outline: none;
  border-color: var(--primary-navy, #000080);
  box-shadow: 0 0 0 3px rgba(0, 0, 128, 0.1);
}

.pilot-field input:disabled,
.pilot-field select:disabled,
.pilot-field textarea:disabled {
  background: var(--gray-100, #f1f5f9);
  color: var(--gray-500, #64748b);
  cursor: not-allowed;
}

.pilot-field input.has-error,
.pilot-field select.has-error {
  border-color: #dc2626;
}

.pilot-hint {
  font-size: 0.8rem;
  color: var(--gray-500, #64748b);
  margin: 0.35rem 0 0;
}

.pilot-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin: 0.35rem 0 0;
  min-height: 0;
  display: none;
}

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

/* Checkboxes */
.pilot-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--gray-700, #334155);
  cursor: pointer;
  margin-bottom: 0.85rem;
}

.pilot-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--primary-navy, #000080);
  cursor: pointer;
}

.pilot-check input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.pilot-check input[type="checkbox"]:disabled + span {
  color: var(--gray-500, #64748b);
}

.pilot-accept {
  font-weight: 600;
}

/* Clinician blocks */
.clinician-block {
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.15rem;
  background: var(--gray-50, #f8fafc);
}

.clinician-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.clinician-block-title {
  font-weight: 700;
  color: var(--primary-navy, #000080);
  font-size: 0.98rem;
  margin: 0;
}

.clinician-remove {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.clinician-remove:hover {
  background: #fef2f2;
}

.pilot-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Agreement */
.pilot-agreement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--gray-50, #f8fafc);
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  font-size: 0.85rem;
  color: var(--gray-600, #475569);
}

.pilot-agreement-scroll {
  height: 380px;
  overflow-y: auto;
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 0 0 10px 10px;
  padding: 1.5rem;
  background: var(--white, #fff);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--gray-700, #334155);
}

.pilot-agreement-scroll:focus {
  outline: 2px solid var(--primary-navy, #000080);
  outline-offset: 2px;
}

.pilot-agreement-scroll h3 {
  font-size: 1.1rem;
  color: var(--primary-navy, #000080);
  margin: 0 0 0.75rem;
}

.pilot-agreement-scroll h4 {
  font-size: 0.95rem;
  color: var(--primary-navy, #000080);
  margin: 1.5rem 0 0.4rem;
}

.pilot-agreement-scroll p {
  margin: 0 0 0.75rem;
}

.pilot-agreement-intro {
  color: var(--gray-600, #475569);
  font-style: italic;
}

.pilot-agreement-end {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200, #e2e8f0);
  color: var(--gray-500, #64748b);
  text-align: center;
}

.pilot-scroll-status {
  font-size: 0.88rem;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin: 0.85rem 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pilot-scroll-status.is-read {
  color: #15803d;
  background: #f0fdf4;
  border-color: #86efac;
}

/* Signature block */
.pilot-signature {
  opacity: 0.55;
  transition: opacity 0.2s;
  pointer-events: none;
}

.pilot-signature.is-unlocked {
  opacity: 1;
  pointer-events: auto;
}

/* Submit */
.pilot-submit-row {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200, #e2e8f0);
}

.pilot-submit {
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
}

.pilot-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pilot-submit-note {
  font-size: 0.82rem;
  color: var(--gray-500, #64748b);
  text-align: center;
  margin: 0.75rem 0 0;
}

/* Result */
.pilot-result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.pilot-result.is-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #14532d;
}

.pilot-result.is-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.pilot-result h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.pilot-result ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.pilot-result li {
  margin-bottom: 0.35rem;
}

/* Tablet */
@media (max-width: 768px) {
  .pilot-grid,
  .pilot-grid-3 {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .pilot-grid .pilot-field {
    margin-bottom: 0;
  }

  .pilot-card {
    padding: 1.25rem;
  }

  .pilot-agreement-scroll {
    height: 320px;
    padding: 1.15rem;
  }

  .pilot-agreement-meta {
    flex-direction: column;
    gap: 0.35rem;
  }

  .pilot-steps {
    gap: 0.35rem;
  }

  .pilot-step-chip {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
  }
}
