/* ==========================================================================
   ChinaMedCare — Plan Builder & Plan Check Styles
   Medical travel plan configuration with real-time cost calculation
   ========================================================================== */

/* ---------- Page Layout ---------- */
.plan-page {
  background: var(--bg-alt);
  min-height: 100vh;
  padding-bottom: 60px;
}

.plan-page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-blue) 100%);
  color: #fff;
  padding: 64px 0 48px;
  position: relative;
  overflow: hidden;
}
.plan-page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  border-radius: 50%;
}
.plan-page-header .container { position: relative; z-index: 1; }
.plan-page-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.plan-page-header p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 600px;
}

/* ---------- Step Navigation ---------- */
.steps-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 40px auto 48px;
  padding: 0 24px;
  max-width: 960px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  flex: 1;
  max-width: 200px;
  justify-content: center;
  border-radius: var(--radius-md);
}
.step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.step-arrow svg {
  width: 20px;
  height: 20px;
}
.step-item.active {
  background: linear-gradient(135deg, var(--highlight), var(--primary-blue));
  color: #fff;
  border-color: transparent;
}
.step-item.active + .step-arrow { color: var(--primary-blue); }
.step-item.completed { background: var(--bg-soft); border-color: var(--highlight); color: var(--highlight); }
.step-item.completed + .step-arrow { color: var(--highlight); }
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-item.active .step-number { background: rgba(255,255,255,0.2); color: #fff; }
.step-item.completed .step-number { background: var(--highlight); color: #fff; }
.step-label { font-size: 15px; font-weight: 600; white-space: nowrap; }

/* ---------- Builder Grid ---------- */
.builder-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Step Content ---------- */
.step-content { display: none; }
.step-content.active { display: block; }
.step-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-section-title .step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--highlight);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Option Cards ---------- */
.options-grid {
  display: grid;
  gap: 12px;
}
.option-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}
.option-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.option-card.selected {
  border-color: var(--highlight);
  background: var(--bg-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.option-card .check-circle {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
}
.option-card.selected .check-circle {
  background: var(--highlight);
  border-color: var(--highlight);
}
.option-card.selected .check-circle::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.option-info { flex: 1; }
.option-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.option-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.option-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  text-align: right;
}
.option-price .price-note {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
}
.option-price-range {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------- Summary Panel (Sticky) ---------- */
.summary-panel {
  position: sticky;
  top: 100px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.summary-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}
.summary-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.summary-header p {
  font-size: 13px;
  color: var(--text-muted);
}
.summary-body { padding: 16px 24px; }
.summary-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.summary-item:last-child { border-bottom: none; }
.summary-item-name { color: var(--text-secondary); }
.summary-item-price { font-weight: 700; color: var(--primary); }
.summary-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-soft);
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}
.summary-total .total-price {
  font-size: 20px;
  color: var(--highlight);
}
.summary-actions {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-actions .btn { width: 100%; }

/* ---------- Form Elements ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}
.form-select, .form-input, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: all 0.2s;
}
.form-select:focus, .form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--highlight);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-textarea { resize: vertical; min-height: 100px; }

/* ---------- Program Cards (Plan Check) ---------- */
.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.program-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}
.program-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow-md); }
.program-card.selected {
  border-color: var(--highlight);
  background: var(--bg-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.program-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.program-card.selected .program-icon { border: 1.5px solid var(--highlight); }
.program-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.program-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---------- Info Cards (Safety & Trust) ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all 0.25s;
}
.info-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.info-card-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}
.info-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.info-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Timeline (My Plan) ---------- */
.timeline {
  position: relative;
  padding-left: 36px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 28px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--highlight);
  border-radius: 50%;
}
.timeline-item.active .timeline-dot { background: var(--highlight); }
.timeline-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--highlight);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.timeline-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.timeline-list {
  list-style: none;
}
.timeline-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.timeline-list li::before {
  content: '•';
  color: var(--highlight);
  font-weight: 700;
}

/* ---------- Estimate Table ---------- */
.estimate-table {
  width: 100%;
  border-collapse: collapse;
}
.estimate-table td {
  padding: 12px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}
.estimate-table td:first-child { color: var(--text-secondary); }
.estimate-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}
.estimate-table tr:last-child td { border-bottom: none; }

/* ---------- Checklist ---------- */
.checklist {
  list-style: none;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
}
.checklist li .check-icon {
  width: 18px;
  height: 18px;
  background: var(--bg-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--highlight);
  flex-shrink: 0;
}

/* ---------- FAQ ---------- */
.faq-list { max-width: 800px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-question:hover { background: var(--bg-alt); }
.faq-question .chevron {
  transition: transform 0.3s;
  font-size: 12px;
  color: var(--text-muted);
}
.faq-item.active .faq-question .chevron { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-item.active .faq-answer { max-height: 300px; }
.faq-answer-inner {
  padding: 0 24px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- CTA Section ---------- */
.cta-section {
  text-align: center;
  padding: 60px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-blue) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  margin: 40px auto;
  max-width: 900px;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  border-radius: 50%;
}
.cta-section h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.cta-section p {
  opacity: 0.85;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ---------- Status Badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.status-draft {
  background: #fef3c7;
  color: #92400e;
}
.status-ready {
  background: #d1fae5;
  color: #065f46;
}

/* ---------- Upload Area ---------- */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}
.upload-area:hover { border-color: var(--highlight); background: var(--bg-soft); }
.upload-area-icon {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.upload-area p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.upload-area span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .builder-grid { grid-template-columns: 1fr; }
  .summary-panel { position: static; margin-top: 24px; }
}
@media (max-width: 768px) {
  .steps-nav { flex-wrap: wrap; gap: 10px; }
  .step-item {
    flex: none;
    width: calc(50% - 5px);
    max-width: none;
    padding: 14px 20px;
  }
  .step-arrow { display: none; }
  .step-label { font-size: 14px; }
  .options-grid { grid-template-columns: 1fr; }
  .program-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .plan-page-header { padding: 40px 0 32px; }
  .cta-section { margin: 24px; border-radius: var(--radius-md); }
}

.line-icon-lg { width:48px; height:48px; color:var(--highlight); display:block; margin:0 auto 12px; }
.program-icon .line-icon-lg { margin:0; }
.line-icon-sm { width:20px; height:20px; color:var(--highlight); display:inline-block; vertical-align:middle; margin-right:6px; }
.line-icon-md { width:32px; height:32px; color:var(--highlight); display:block; margin:0 auto 8px; }
