/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0F6E56;
  --primary-light: #E1F5EE;
  --primary-dark: #085041;
  --accent: #12B981;
  --danger: #EF4444;
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --border: #D1FAE5;
  --bg: #EDEEF2;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(15,110,86,0.10);
  --form-bg: #F8FAFF;
  --form-border: #C7D7F0;
  --section-bg: linear-gradient(135deg, #F0F7FF 0%, #E8F5F0 100%);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(160deg, #B2D8F5 0%, #C8E6D8 40%, #D4C8F0 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ===== APP SHELL ===== */
.app {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #F0F6FF;
  box-shadow: 0 0 60px rgba(0,0,0,0.22), 0 4px 24px rgba(15,110,86,0.10);
  position: relative;
}

.page-content {
  flex: 1;
  padding: 0 0 80px 0;
  overflow-y: auto;
}

/* ===== HEADER ===== */
.app-header {
  background: var(--primary);
  color: var(--white);
  padding: 18px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-back {
  background: none;
  border: none;
  color: var(--white);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.9;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.logo-img {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
  background: var(--white);
  border-radius: 8px;
  padding: 3px;
}

.logo-text {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--white);
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.logo-sub {
  font-size: 11px;
  opacity: 0.85;
  letter-spacing: 0.4px;
  margin-top: 2px;
}

.header-title {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  text-align: center;
}

/* ===== LAB PARTNERS SECTION ===== */
.lab-partners-section {
  margin-top: 14px;
  padding: 0 16px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.lab-partners-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.lab-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  box-sizing: border-box;
}

/* Single lab gets full-width strip instead of grid */
.lab-thumbs-grid.single {
  grid-template-columns: 1fr;
}

.lab-thumb {
  border-radius: 12px;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  min-height: 60px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  border: 3px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lab-thumb.selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.6), 0 4px 14px rgba(0,0,0,0.22);
}
.lab-thumb-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #0F6E56;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}
.lab-thumb.selected .lab-thumb-check {
  opacity: 1;
  transform: scale(1);
}

.lab-thumb-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.lab-thumb-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.lab-thumb-name {
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.lab-thumb-tag {
  font-size: 10px;
  opacity: 0.82;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== BANNER ===== */
.promo-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  margin: 14px 16px;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.promo-banner .promo-icon { font-size: 28px; }

.promo-banner .promo-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.promo-banner .promo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 2px;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 13px;
  font-weight: 800;
  color: #083D6E;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 18px 16px 8px;
}

/* ===== OPTION CARDS ===== */
.option-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px;
}

.option-card {
  border-radius: var(--radius);
  padding: 22px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  border: none;
}

.option-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  transform: translateY(-3px);
}

.option-card-home {
  background: linear-gradient(135deg, #0F6E56 0%, #1A9E7A 60%, #22C55E 100%);
  box-shadow: 0 6px 22px rgba(15,110,86,0.35);
}

.option-card-lab {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 60%, #38BDF8 100%);
  box-shadow: 0 6px 22px rgba(29,78,216,0.30);
}

.option-card:active { transform: scale(0.98); }

.option-card:hover { border-color: var(--primary); }

.option-card .card-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.option-card .card-body { flex: 1; }

.option-card .card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

.option-card .card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.option-card .card-arrow {
  font-size: 20px;
  color: var(--primary);
  opacity: 0.6;
}

/* ===== FORM ===== */
.form-section {
  padding: 0 16px;
  margin-top: 4px;
  background: var(--form-bg);
  border-radius: var(--radius);
  border: 1.5px solid var(--form-border);
  margin-left: 12px;
  margin-right: 12px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(99,130,200,0.08);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input {
  width: 100%;
  border: 1.5px solid #C7D7F0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #FFFFFF;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  box-shadow: 0 1px 4px rgba(99,130,200,0.07);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,110,86,0.12);
}

.form-input::placeholder { color: #9CA3AF; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===== CHIPS ===== */
.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  background: var(--primary-light);
  border: 1.5px solid var(--border);
  color: var(--primary-dark);
  border-radius: 20px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.chip:active { transform: scale(0.95); }

.custom-test-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.custom-test-row .form-input { flex: 1; }

.btn-add {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

/* ===== BUTTONS ===== */
.btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  font-family: inherit;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(15,110,86,0.3);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-white {
  background: var(--white);
  color: var(--primary-dark);
  border: 2px solid var(--border);
}

.btn-footer {
  margin: 16px 16px;
}

/* ===== PAYMENT MODES ===== */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.payment-option {
  border: 2px solid #D1D5DB;
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
  position: relative;
}

.payment-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.payment-option .pay-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-option .pay-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.pay-badge {
  background: #F59E0B;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.radio-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  position: absolute;
  top: 16px;
  right: 16px;
  transition: all 0.15s;
}

.payment-option.selected .radio-dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 4px var(--white);
}

/* ===== QR BOX ===== */
.qr-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 18px;
  text-align: center;
  display: none;
}

.qr-box.visible { display: block; }

.qr-img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
  border-radius: 8px;
}

.qr-merchant { font-size: 15px; font-weight: 700; color: var(--primary-dark); }
.qr-phone { font-size: 13px; color: var(--text-muted); margin: 2px 0; }
.qr-upi { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; font-family: monospace; }

.upi-apps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.upi-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.upi-app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid #E5E7EB;
}

/* ===== ORDER SUMMARY ===== */
.summary-card {
  background: var(--primary-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 16px;
}

.summary-card .sum-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 13.5px;
  padding: 4px 0;
  color: var(--text);
}

.sum-row .label { color: var(--text-muted); }
.sum-row .value { font-weight: 600; text-align: right; max-width: 60%; }

.sum-divider {
  border: none;
  border-top: 1px dashed #A7F3D0;
  margin: 8px 0;
}

.sum-total .label { font-weight: 700; color: var(--text); }
.sum-total .value { font-size: 16px; font-weight: 800; color: var(--primary-dark); }

.sum-discount .value { color: #16A34A; }

/* ===== LAB PASS ===== */
.labpass-wrap {
  padding: 16px;
}

.labpass-card {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15,110,86,0.15);
  border: 1.5px solid var(--border);
}

.labpass-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 20px 20px 18px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.labpass-logo {
  display: flex;
  flex-direction: column;
}

.labpass-logo .lp-name {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 3px;
}

.labpass-logo .lp-sub {
  font-size: 10px;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

.paid-badge {
  background: #22C55E;
  color: var(--white);
  font-size: 20px;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 8px;
  letter-spacing: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.labpass-body {
  padding: 20px;
}

.lp-field {
  margin-bottom: 14px;
}

.lp-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.lp-field-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.lp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.lp-tests-list {
  list-style: none;
  padding: 0;
}

.lp-tests-list li {
  font-size: 13.5px;
  color: var(--text);
  padding: 3px 0 3px 16px;
  position: relative;
  font-weight: 500;
}

.lp-tests-list li::before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: 0;
  font-weight: 900;
}

.pass-divider {
  margin: 18px -20px;
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
}

.pass-divider::before,
.pass-divider::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--bg);
  border-radius: 50%;
  top: 0;
  border: 1.5px solid var(--border);
}

.pass-divider::before { left: -11px; }
.pass-divider::after { right: -11px; }

.pass-divider-line {
  flex: 1;
  border: none;
  border-top: 2px dashed #A7F3D0;
  margin: 0 18px;
}

.labpass-footer {
  padding: 16px 20px 20px;
  background: var(--primary-light);
}

.lp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #DCFCE7;
  color: #16A34A;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #A7F3D0;
}

/* ===== CONFIRMATION ===== */
.confirm-wrap {
  padding: 20px 16px;
  text-align: center;
}

.confirm-icon {
  width: 80px;
  height: 80px;
  background: #DCFCE7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 10px auto 16px;
}

.confirm-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.confirm-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.booking-id-box {
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: inline-block;
  min-width: 200px;
}

.booking-id-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.booking-id-value {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary-dark);
  font-family: monospace;
  letter-spacing: 1px;
  margin-top: 4px;
}

.confirm-summary {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  margin-bottom: 16px;
}

.confirm-summary .sum-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.savings-box {
  background: #DCFCE7;
  border: 1.5px solid #A7F3D0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #16A34A;
  font-weight: 600;
  font-size: 14px;
}

/* ===== SUPPORT FOOTER ===== */
.support-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-top: 1.5px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.support-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 14.5px;
}

.support-footer .support-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.support-icon { font-size: 16px; }

/* ===== MISC ===== */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }

.error-msg {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.loading-btn {
  opacity: 0.7;
  pointer-events: none;
}

/* ===== PRINT STYLES ===== */
@media print {
  .support-footer, .btn, .btn-footer, .print-hide { display: none !important; }
  .app { box-shadow: none; max-width: 100%; }
  body { background: white; }
  .labpass-card { box-shadow: none; border: 1px solid #ccc; }
  .labpass-header { background: #0F6E56 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .paid-badge { background: #22C55E !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (min-width: 421px) {
  .support-footer { left: 50%; }
}

/* ===== EXTRA TESTS NOTE ===== */
.extra-note {
  margin-top: 10px;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: #92400E;
  line-height: 1.5;
}

/* ===== PACKAGE CARDS ===== */
.package-card {
  background: linear-gradient(135deg, #FFF8F0 0%, #FFF0F0 100%);
  border: 1.5px solid #FFD0B0;
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: 0 2px 8px rgba(255,160,100,0.10);
}
.package-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.pkg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.pkg-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.pkg-price {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}
.pkg-tests {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.package-card.selected .pkg-name,
.package-card.selected .pkg-tests {
  color: var(--primary-dark);
}
