/* ─── Intake Wizard ─────────────────────────────────────────────────────── */

.intake-wizard {
  font-family: Helvetica, Verdana, Geneva, sans-serif;
  font-size: 15px;
  max-width: 900px;
}

/* ── Stepper ── */
.intake-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 10px 0 6px;
  position: relative;
}

.intake-stepper::before {
  content: '';
  position: absolute;
  top: 21px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: #d0d0d0;
  z-index: 0;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #d0d0d0;
  color: #777;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #b8b8b8;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.step-node[role="button"] { cursor: pointer; outline: none; }
.step-node[role="button"]:hover .step-circle { transform: scale(1.08); border-color: #295a31; }
.step-node[role="button"]:focus-visible .step-circle {
  box-shadow: 0 0 0 3px rgba(56, 154, 71, 0.45);
}

.step-circle.done {
  background: #295a31;
  color: white;
  border-color: #1e4224;
}

.step-circle.active {
  background: #389a47;
  color: white;
  border-color: #295a31;
  box-shadow: 0 0 0 3px rgba(56, 154, 71, 0.2);
}

.step-label {
  font-size: 9px;
  color: #aaa;
  text-align: center;
  margin-top: 4px;
  max-width: 58px;
  line-height: 1.2;
  white-space: normal;
}

.step-label.active {
  color: #295a31;
  font-weight: bold;
}

/* ── Step containers ── */
.intake-step {
  display: none;
}

.intake-step.active {
  display: block;
}

.intake-step-title {
  border-left: 4px solid #389a47;
  padding-left: 10px;
  margin: 0 0 20px;
  color: #295a31;
  font-size: 1.15em;
}

/* ── Field groups ── */
.intake-field-group {
  margin-bottom: 14px;
}

.intake-field-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
  color: #2c2c2c;
  font-size: 13px;
}

.intake-field-group .req {
  color: #c0392b;
  margin-left: 2px;
}

.intake-field-group input[type="text"],
.intake-field-group input[type="date"],
.intake-field-group input[type="tel"],
.intake-field-group input[type="email"],
.intake-field-group textarea,
.intake-field-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  background: #fafafa;
  transition: border-color 0.15s;
}

.intake-field-group textarea {
  resize: vertical;
  min-height: 70px;
}

.intake-field-group input:focus,
.intake-field-group textarea:focus,
.intake-field-group select:focus {
  border-color: #389a47;
  outline: none;
  background: #fff;
}

.intake-field-group input.error,
.intake-field-group textarea.error {
  border-color: #c0392b;
}

.intake-field-error {
  color: #c0392b;
  font-size: 12px;
  margin-top: 3px;
  display: none;
}

.intake-field-error.visible {
  display: block;
}

.intake-row {
  display: flex;
  gap: 14px;
}

.intake-row .intake-field-group {
  flex: 1;
}

/* ── Helper / note ── */
.intake-helper {
  font-size: 11px;
  color: #888;
  margin-top: 3px;
  line-height: 1.4;
}

.intake-note {
  font-size: 13px;
  color: #555;
  background: #f0f8f0;
  border-left: 3px solid #389a47;
  padding: 8px 12px;
  margin-bottom: 16px;
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}

.intake-section-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 20px 0;
}

.intake-subsection-title {
  font-size: 13px;
  font-weight: bold;
  color: #389a47;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Condition checkbox grid ── */
.intake-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 12px;
  margin-bottom: 10px;
}

.intake-checkbox-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 720px) {
  .intake-checkbox-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.cond-category {
  margin-bottom: 12px;
}

.cond-cat-title {
  font-size: 12px;
  font-weight: bold;
  color: #295a31;
  margin: 8px 0 6px;
  padding: 2px 0 2px 8px;
  border-left: 3px solid #389a47;
  background: #f0f8f0;
}

.intake-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: normal;
  color: #333;
}

.intake-checkbox-grid input[type="checkbox"] {
  accent-color: #389a47;
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Dynamic rows ── */
.dynamic-list {
  margin-bottom: 8px;
}

.dynamic-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
}

.dynamic-row input {
  flex: 1;
  padding: 7px 9px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
}

.dynamic-row input:focus {
  border-color: #389a47;
  outline: none;
  background: #fff;
}

.remove-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #aaa;
  font-size: 16px;
  cursor: pointer;
  padding: 3px 8px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.remove-btn:hover {
  color: #c0392b;
  border-color: #c0392b;
}

.intake-add-btn {
  background: none;
  border: 1px solid #389a47;
  color: #389a47;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  margin-top: 4px;
}

.intake-add-btn:hover {
  background: #389a47;
  color: #fff;
}

/* ── Conditional section ── */
.intake-conditional {
  display: none;
  margin-top: 14px;
  padding: 14px;
  background: #f7faf7;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
}

.intake-conditional.visible {
  display: block;
}

/* ── Policy text box ── */
.intake-policy-box {
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 12px;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 10px;
  line-height: 1.65;
  color: #444;
}

.intake-policy-box ul {
  margin: 6px 0;
  padding-left: 18px;
}

.intake-policy-box li {
  margin-bottom: 4px;
}

.intake-policy-link {
  font-size: 12px;
  color: #295a31;
  display: inline-block;
  margin-bottom: 10px;
}

/* ── Agreement row ── */
.intake-agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #f7faf7;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
  margin-bottom: 6px;
}

.intake-agree-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #389a47;
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.intake-agree-row label {
  font-size: 13px;
  cursor: pointer;
  line-height: 1.5;
  font-weight: normal;
  color: #333;
}

/* ── Signature pad ── */
.sig-container {
  border: 2px solid #ccc;
  border-radius: 4px;
  background: #fff;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}

.sig-container.error {
  border-color: #c0392b;
}

.sig-container canvas {
  display: block;
  width: 100%;
  height: 140px;
  cursor: crosshair;
  border-radius: 2px;
}

.sig-helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sig-clear-btn {
  background: none;
  border: 1px solid #bbb;
  color: #777;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.sig-clear-btn:hover {
  border-color: #c0392b;
  color: #c0392b;
}

/* ── Review ── */
.intake-review {
  background: #f7faf7;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}

.review-section {
  margin-bottom: 12px;
}

.review-section:last-child {
  margin-bottom: 0;
}

.review-section h4 {
  margin: 0 0 6px;
  color: #295a31;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #c8e6c9;
  padding-bottom: 3px;
}

.review-row {
  display: flex;
  gap: 8px;
  margin-bottom: 3px;
}

.review-label {
  font-weight: bold;
  min-width: 130px;
  flex-shrink: 0;
  color: #444;
}

/* ── Navigation ── */
.intake-nav {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.intake-nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.intake-nav-footer {
  margin-top: 10px;
  text-align: center;
}

.intake-btn {
  padding: 9px 22px;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  font-weight: bold;
}

.intake-btn-primary {
  background: #389a47;
  color: #fff;
}

.intake-btn-primary:hover {
  background: #295a31;
}

.intake-btn-primary:disabled {
  background: #a0c8a5;
  cursor: not-allowed;
}

.intake-btn-secondary {
  background: transparent;
  color: #389a47;
  border: 1px solid #389a47;
}

.intake-btn-secondary:hover {
  background: #f0f8f0;
}

.intake-step-count {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: #888;
}

/* ── Records release radio choice ── */
.intake-records-auth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 6px;
}

.intake-radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.intake-radio-label input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #389a47;
}

/* -- Privacy / device-storage notice -- */
.intake-storage-notice {
  border: 1px solid #cfd8dc;
  background: #f5f8fa;
  color: #344a55;
  border-radius: 4px;
  padding: 10px 14px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
}

/* -- Draft resume UI -- */
.intake-draft-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8c483;
  background: #fff9e6;
  color: #5f4b13;
  border-radius: 4px;
  padding: 10px 12px;
  margin: 0 0 16px;
}

.intake-draft-banner.visible {
  display: flex;
}

.intake-draft-banner-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.intake-draft-stamp {
  font-size: 12px;
  color: #7a6632;
}

.intake-draft-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Yes/No question blocks (Personal History / Fractures / Injuries) ── */
.intake-yn-block {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
}

.intake-yn-question {
  font-size: 13px;
  font-weight: bold;
  color: #2c2c2c;
  margin: 0 0 6px;
}

.intake-yn-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.intake-yn-describe {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #d6d6d6;
}

.intake-yn-describe.visible {
  display: block;
}

.intake-yn-describe .intake-field-group {
  margin-bottom: 6px;
}

/* ── Expandable family-history block ── */
.intake-expandable {
  margin-top: 10px;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
  background: #f7faf7;
  padding: 10px 14px;
}

.intake-expandable[open] {
  background: #fff;
}

.intake-expandable summary {
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  outline: none;
}

.intake-expandable summary::-webkit-details-marker { display: none; }

.intake-expandable summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 6px;
  color: #389a47;
  transition: transform 0.15s;
}

.intake-expandable[open] summary::before {
  transform: rotate(90deg);
}

/* ── Family-history table ── */
.intake-family-table {
  display: block;
  margin-top: 10px;
  font-size: 12px;
}

.intake-family-row {
  display: grid;
  grid-template-columns: 90px repeat(4, 1fr);
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.intake-family-header {
  grid-template-columns: 90px 2fr 2fr;
}

.intake-family-header .intake-family-section {
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  color: #295a31;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 4px 0;
  background: #f0f8f0;
  border-radius: 3px;
}

.intake-family-subheader .intake-family-cell {
  font-weight: bold;
  font-size: 11px;
  color: #555;
}

.intake-family-cell {
  min-width: 0;
}

.intake-family-label {
  font-weight: bold;
  color: #295a31;
}

.intake-family-cell input[type="text"] {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 12px;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
}

.intake-family-cell input:focus {
  border-color: #389a47;
  outline: none;
  background: #fff;
}

@media (max-width: 720px) {
  .intake-family-row,
  .intake-family-header,
  .intake-family-subheader {
    grid-template-columns: 1fr 1fr;
  }
  .intake-family-header .intake-family-section { grid-column: span 1; }
}

/* Records-release radio rows: align label text with radio */
.intake-records-auth .intake-radio-label {
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  background: #fafafa;
}

.intake-records-auth .intake-radio-label:hover {
  background: #f0f8f0;
  border-color: #389a47;
}

.intake-draft-btn {
  padding: 6px 12px;
  font-size: 12px;
}

.intake-clear-draft-link {
  border: none;
  background: none;
  color: #8b2f2f;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.intake-clear-draft-link:hover {
  color: #6f2020;
}

.intake-clear-draft-link.hidden {
  display: none;
}

/* ── Global error ── */
.intake-global-error {
  background: #fdecea;
  border: 1px solid #e57373;
  color: #c0392b;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}

.intake-global-error.visible {
  display: block;
}

/* ── Success screen ── */
.intake-success {
  text-align: center;
  padding: 48px 20px;
  display: none;
}

.intake-success.visible {
  display: block;
}

.intake-success-icon {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 16px;
  color: #389a47;
}

.intake-success h2 {
  color: #295a31;
  margin-bottom: 12px;
  font-size: 1.4em;
}

.intake-success p {
  color: #555;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 14px;
}

.intake-success-downloads {
  max-width: 460px;
  margin: 28px auto 0;
  padding: 18px 22px;
  border: 1px solid #cfe3d3;
  border-radius: 8px;
  background: #f4faf5;
  text-align: left;
}

.intake-success-downloads h3 {
  color: #295a31;
  font-size: 1.05em;
  margin: 0 0 6px;
}

.intake-success-downloads p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #555;
}

.intake-success-downloads ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.intake-success-downloads li {
  margin: 6px 0;
}

.intake-success-downloads a {
  color: #389a47;
  font-weight: 600;
  text-decoration: underline;
}

.intake-success-downloads a:hover {
  color: #295a31;
}

@media (max-width: 760px) {
  .intake-draft-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .intake-draft-actions {
    width: 100%;
  }

  .intake-nav-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .intake-step-count {
    order: 3;
    width: 100%;
    text-align: center;
  }
}
