/* ===== Pre-Visit Page Styles ===== */

.pv-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero */
.pv-hero {
  padding: 40px 0 30px;
}
.pv-hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  align-items: center;
}
.pv-hero-text .eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: rgba(22,133,119,.08);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.pv-hero-text h1 {
  font-size: 28px;
  line-height: 1.3;
  margin: 0 0 12px;
}
.pv-hero-text .lead {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 20px;
}
.pv-hero-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.pv-feature {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}
.pv-feature strong {
  white-space: nowrap;
}
.pv-feature span {
  color: var(--muted);
}
.pv-hero-actions {
  display: flex;
  gap: 12px;
}
.pv-hero-img img {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* Progress Bar */
.pv-progress-bar {
  position: sticky;
  top: 60px;
  z-index: 15;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(20,55,58,.06);
}
.pv-progress-inner {
  height: 6px;
  background: var(--subtle);
  border-radius: 3px;
  overflow: hidden;
}
.pv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  border-radius: 3px;
  transition: width .4s ease;
}
.pv-progress-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}

/* Steps */
.pv-step {
  margin-bottom: 30px;
}
.pv-step[hidden] {
  display: none;
}
.pv-step-inner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(20,55,58,.05);
}
.pv-step-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.pv-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.pv-step-header h2 {
  font-size: 20px;
  margin: 0 0 4px;
}
.pv-step-header p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

/* Choice Grid (Step 1) */
.pv-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.pv-choice {
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.pv-choice:hover {
  border-color: var(--brand);
  background: rgba(22,133,119,.04);
}
.pv-choice.selected {
  border-color: var(--brand);
  background: rgba(22,133,119,.08);
  box-shadow: 0 0 0 3px rgba(22,133,119,.12);
}
.pv-choice-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}
.pv-choice strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}
.pv-choice span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* Form Groups */
.pv-form-group {
  margin-bottom: 22px;
}
.pv-form-group > label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

/* Body Map */
.pv-body-map {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pv-body-option {
  padding: 8px 14px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.pv-body-option:hover {
  border-color: var(--brand);
}
.pv-body-option.selected {
  background: rgba(22,133,119,.1);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.pv-body-side {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.pv-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}
.pv-radio input[type="radio"] {
  accent-color: var(--brand);
}

/* Pain Slider */
.pv-pain-slider {
  padding: 0 4px;
}
.pv-pain-slider input[type="range"] {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #4caf50 0%, #ff9800 50%, #f44336 100%);
  border-radius: 4px;
  outline: none;
}
.pv-pain-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 3px solid var(--brand);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.pv-pain-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.pv-pain-current {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
}

/* Pills (multi-select) */
.pv-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pv-pill {
  padding: 8px 16px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.pv-pill:hover {
  border-color: var(--brand);
}
.pv-pill.selected {
  background: rgba(22,133,119,.1);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

/* Textarea */
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  background: var(--bg);
  transition: border-color .2s;
}
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22,133,119,.1);
}

/* Photo Upload */
.pv-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.pv-photo-card {
  text-align: center;
}
.pv-photo-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 2px dashed var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  transition: border-color .2s;
  cursor: pointer;
}
.pv-photo-preview:hover {
  border-color: var(--brand);
}
.pv-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pv-photo-placeholder {
  font-size: 36px;
  opacity: .4;
}
.pv-photo-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
  cursor: pointer;
  color: var(--brand);
}
.pv-photo-tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.pv-photo-guide {
  background: var(--subtle);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
}
.pv-photo-guide strong {
  display: block;
  margin-bottom: 6px;
}
.pv-photo-guide ul {
  margin: 0;
  padding-left: 18px;
}
.pv-photo-guide li {
  margin-bottom: 4px;
}

/* Questions */
.pv-questions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}
.pv-question-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg);
  transition: border-color .2s;
}
.pv-question-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22,133,119,.1);
}

/* Step Navigation */
.pv-step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}
.btn.primary {
  background: var(--brand);
  color: #fff;
}
.btn.primary:hover {
  background: var(--brand-dark);
}
.btn.primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn.subtle {
  background: var(--subtle);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.subtle:hover {
  background: var(--line);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
}
.btn.ghost:hover {
  color: var(--brand);
}

/* Summary */
.pv-summary-section {
  margin-bottom: 40px;
}
.pv-summary-card {
  background: #f8fffe;
  border: 1.5px solid rgba(22,133,119,.2);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.pv-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.pv-summary-header strong {
  font-size: 16px;
}
.pv-summary-header span {
  font-size: 13px;
  color: var(--muted);
}
.pv-summary-text {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", monospace;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--ink);
  background: transparent;
}
.pv-summary-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

/* Checklist */
.pv-checklist {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 30px;
}
.pv-checklist h3 {
  font-size: 18px;
  margin: 0 0 16px;
}
.pv-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pv-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 14px;
}
.pv-checklist-item input[type="checkbox"] {
  accent-color: var(--brand);
  margin-top: 3px;
  flex-shrink: 0;
}

/* Cross Links */
.pv-cross-links {
  margin-bottom: 30px;
}
.pv-cross-links h3 {
  font-size: 18px;
  margin: 0 0 14px;
}
.pv-cross-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.pv-cross-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  transition: all .2s;
  display: block;
}
.pv-cross-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(22,133,119,.08);
}
.pv-cross-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--brand);
}
.pv-cross-card span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* Boundary */
.pv-boundary {
  background: var(--subtle);
  padding: 30px 20px;
  margin-top: 20px;
  text-align: center;
}
.pv-boundary-inner {
  max-width: 700px;
  margin: 0 auto;
}
.pv-boundary h2 {
  font-size: 18px;
  margin: 0 0 10px;
}
.pv-boundary p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
}

/* Copy feedback */
.pv-copy-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  background: rgba(23,43,47,.9);
  color: #fff;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
}
.pv-copy-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Active nav link */
.nav-links a.active {
  color: var(--brand);
  font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .pv-hero-inner {
    grid-template-columns: 1fr;
  }
  .pv-hero-img {
    order: -1;
  }
  .pv-hero-img img {
    max-height: 200px;
    object-fit: cover;
  }
  .pv-hero-text h1 {
    font-size: 22px;
  }
  .pv-choice-grid {
    grid-template-columns: 1fr;
  }
  .pv-photo-grid {
    grid-template-columns: 1fr;
  }
  .pv-checklist-grid {
    grid-template-columns: 1fr;
  }
  .pv-cross-grid {
    grid-template-columns: 1fr;
  }
  .pv-summary-actions {
    flex-direction: column;
  }
  .pv-summary-actions .btn {
    width: 100%;
  }
  .pv-step-inner {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .pv-main {
    padding: 0 12px;
  }
  .pv-hero {
    padding: 20px 0;
  }
  .pv-body-map {
    gap: 6px;
  }
  .pv-body-option {
    padding: 6px 10px;
    font-size: 13px;
  }
}
