/* ================================================================
   PHC Safety Net — Frontend Styles  v1.2
   Device-agnostic: mobile-first, scales to desktop.
   ================================================================ */

:root {
  --phcsn-or:   #ff915a;
  --phcsn-or2:  #e8814e;
  --phcsn-gn:   #8bc38b;
  --phcsn-dk:   #2d2d2d;
  --phcsn-bd:   #d1d5db;
  --phcsn-bd2:  #e5e7eb;
  --phcsn-bg:   #f8f9fa;
  --phcsn-r:    10px;
  --phcsn-r-lg: 16px;
}

/* ── BANNER — fixed top, device-agnostic ────────────────────── */
.phcsn-banner {
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 99999;
  background: var(--phcsn-or);
  color: #fff;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(255,145,90,.4);
  box-sizing: border-box;
  width: 100%;
  /* prevent content from extending under notch on modern phones */
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}
.phcsn-banner__msg {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  line-height: 1.5;
  padding-top: 2px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.phcsn-banner__cta {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
  margin-left: 6px;
  display: inline;
}
.phcsn-banner__x {
  background: rgba(255,255,255,.22);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  padding: 0;
  margin-top: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.phcsn-banner__x:hover  { background: rgba(255,255,255,.38); }
.phcsn-banner__x:active { background: rgba(255,255,255,.5); }

/* Mobile banner: left-align + block CTA */
@media (max-width: 600px) {
  .phcsn-banner {
    font-size: 13px;
    padding: 9px 10px 9px 14px;
    align-items: flex-start;
  }
  .phcsn-banner__msg  { text-align: left; }
  .phcsn-banner__cta  { display: block; margin-left: 0; margin-top: 3px; }
}

/* ── PAGE WRAP ────────────────────────────────────────────────── */
.phcsn-wrap {
  max-width: 640px;
  margin: 32px auto 40px;
  padding: 0 16px;
  box-sizing: border-box;
  width: 100%;
}
@media (max-width: 600px) {
  .phcsn-wrap { margin: 20px auto 28px; padding: 0 12px; }
}

/* ── FORM CARD ────────────────────────────────────────────────── */
#phcsn-step-form {
  background: #fff;
  border: 1px solid var(--phcsn-bd2);
  border-radius: var(--phcsn-r-lg);
  padding: 32px 36px 36px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  box-sizing: border-box;
}
@media (max-width: 600px) {
  #phcsn-step-form { padding: 20px 16px 24px; border-radius: var(--phcsn-r); }
}

/* ── FORM LAYOUT ──────────────────────────────────────────────── */
.phcsn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .phcsn-row { grid-template-columns: 1fr; gap: 0; }
}

.phcsn-field { margin-bottom: 18px; }
.phcsn-field:last-child { margin-bottom: 0; }

/* ── CONSULTATION TYPE INFO CARD ──────────────────────────────── */
.phcsn-consult-info {
  margin-top: 8px;
  padding: 10px 14px;
  background: #fff8f5;
  border: 1px solid #ffd5b8;
  border-radius: var(--phcsn-r);
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
}
.phcsn-consult-info strong {
  display: block;
  color: var(--phcsn-or);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}
.phcsn-consult-fee-tag {
  display: inline-block;
  background: var(--phcsn-or);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
  margin-top: 5px;
}

/* ── FEE DISPLAY IN PAYMENT CARD (after submission) ──────────── */
.phcsn-fee-display {
  background: #fff8f5;
  border: 1px solid #ffd5b8;
  border-radius: var(--phcsn-r);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #1f2937;
  line-height: 1.6;
}
.phcsn-fee-display .phcsn-fee-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--phcsn-or);
}

/* ── LABELS ───────────────────────────────────────────────────── */
.phcsn-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.phcsn-req { color: var(--phcsn-or); margin-left: 1px; }
.phcsn-hint-text { display:block; font-size:11px; color:#9ca3af; margin-top:4px; font-style:italic; }

/* ── INPUTS ───────────────────────────────────────────────────── */
.phcsn-input,
.phcsn-select,
.phcsn-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--phcsn-bd);
  border-radius: var(--phcsn-r);
  font-size: 16px; /* 16px prevents iOS auto-zoom */
  color: #1f2937;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color .18s, box-shadow .18s;
  appearance: none;
  -webkit-appearance: none;
  max-width: 100%;
}
.phcsn-input:focus,
.phcsn-select:focus,
.phcsn-textarea:focus {
  outline: none;
  border-color: var(--phcsn-or);
  box-shadow: 0 0 0 3px rgba(255,145,90,.18);
}
.phcsn-input.error,
.phcsn-select.error,
.phcsn-textarea.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
.phcsn-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
.phcsn-textarea { resize: vertical; min-height: 90px; }
.phcsn-charcount { font-size:11px; color:#9ca3af; display:block; margin-top:4px; text-align:right; }

/* ── RADIO / CHECKBOX ─────────────────────────────────────────── */
.phcsn-radios { display:flex; gap:20px; padding:4px 0; flex-wrap:wrap; }
.phcsn-radio {
  display:flex; align-items:center; gap:7px;
  font-size:15px; color:#374151; cursor:pointer; line-height:1;
  /* larger tap target on mobile */
  padding: 4px 0;
}
.phcsn-radio input[type="radio"] {
  width:18px; height:18px;
  accent-color: var(--phcsn-or);
  cursor:pointer; flex-shrink:0;
}
.phcsn-consent {
  display:flex; align-items:flex-start; gap:10px;
  font-size:14px; color:#4b5563; cursor:pointer; line-height:1.6;
  padding:12px 14px; background:#f9fafb;
  border:1px solid var(--phcsn-bd2); border-radius:var(--phcsn-r);
}
.phcsn-consent input[type="checkbox"] {
  width:17px; height:17px; accent-color:var(--phcsn-or);
  flex-shrink:0; margin-top:2px; cursor:pointer;
}

/* ── SUBMIT BUTTON ────────────────────────────────────────────── */
.phcsn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--phcsn-r);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: inherit;
  transition: all .2s;
  line-height: 1;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.phcsn-btn--primary {
  background: var(--phcsn-or);
  color: #fff;
  box-shadow: 0 3px 12px rgba(255,145,90,.35);
  width: 100%;
  margin-top: 6px;
  padding: 14px 28px;
}
.phcsn-btn--primary:hover  { background:var(--phcsn-or2); box-shadow:0 5px 16px rgba(255,145,90,.45); transform:translateY(-1px); }
.phcsn-btn--primary:active { transform:translateY(0); }
.phcsn-btn--primary:disabled {
  background:#d1d5db; color:#9ca3af; cursor:not-allowed; transform:none; box-shadow:none;
}

/* ── ALERTS ───────────────────────────────────────────────────── */
.phcsn-alert {
  padding:12px 16px; border-radius:var(--phcsn-r); font-size:14px;
  margin-bottom:18px; line-height:1.5; border-width:1px; border-style:solid;
  box-sizing:border-box;
}
.phcsn-alert--error   { background:#fef2f2; color:#991b1b; border-color:#fca5a5; }
.phcsn-alert--success { background:#f0fdf4; color:#166534; border-color:#86efac; }

/* ── SUCCESS CARD ─────────────────────────────────────────────── */
#phcsn-step-success { padding:0; }
.phcsn-success-card {
  background:#fff; border:1px solid var(--phcsn-bd2);
  border-radius:var(--phcsn-r-lg); padding:36px 36px 32px;
  box-shadow:0 2px 16px rgba(0,0,0,.07); text-align:center; margin-bottom:20px;
  box-sizing:border-box;
}
@media (max-width:600px) { .phcsn-success-card { padding:22px 16px 20px; } }
.phcsn-success-icon {
  width:56px; height:56px; background:#d1fae5; color:#059669;
  border-radius:50%; font-size:26px;
  display:flex; align-items:center; justify-content:center;
  margin:0 auto 18px; font-weight:700; border:2px solid #6ee7b7;
}
.phcsn-success-title { font-size:22px; font-weight:700; color:#111827; margin:0 0 10px; }
.phcsn-success-body  { font-size:15px; color:#4b5563; margin:0 0 18px; line-height:1.6; }
.phcsn-ref-line      { font-size:14px; color:#6b7280; margin:0 0 6px; }

/* ── PAYMENT CARD ─────────────────────────────────────────────── */
.phcsn-payment-card {
  background:#fff; border:1px solid var(--phcsn-bd2);
  border-radius:var(--phcsn-r-lg); overflow:hidden;
  box-shadow:0 2px 16px rgba(0,0,0,.07); margin-top:20px;
  box-sizing:border-box;
}
.phcsn-payment-card__hdr {
  background:var(--phcsn-or); color:#fff; font-weight:700; font-size:15px;
  padding:14px 20px; display:flex; align-items:center; gap:8px;
}
.phcsn-payment-card__body { padding:22px 24px 24px; box-sizing:border-box; }
@media (max-width:600px) { .phcsn-payment-card__body { padding:14px 14px 18px; } }

.phcsn-pay-note {
  font-size:13px; color:#6b7280; background:#f9fafb; border:1px solid var(--phcsn-bd2);
  border-radius:var(--phcsn-r); padding:10px 14px; margin-bottom:18px; line-height:1.6;
}
.phcsn-pay-row {
  display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap;
}
.phcsn-pay-lbl { font-size:11px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:.6px; min-width:44px; }
.phcsn-pay-upi {
  flex:1; background:#f3f4f6; padding:8px 12px; border-radius:8px;
  font-size:14px; font-family:'Courier New',monospace; color:#1f2937;
  word-break:break-all; border:1px solid var(--phcsn-bd2); min-width:0;
}
.phcsn-copy-btn {
  padding:7px 14px; font-size:12px; font-weight:600; border-radius:8px;
  border:1.5px solid var(--phcsn-bd); background:#fff; cursor:pointer;
  color:#374151; white-space:nowrap; flex-shrink:0; transition:all .15s;
  font-family:inherit; -webkit-tap-highlight-color:transparent;
}
.phcsn-copy-btn:hover { background:var(--phcsn-or); color:#fff; border-color:var(--phcsn-or); }

.phcsn-pay-qr {
  text-align:center; padding:16px 0 8px;
  border-top:1px solid var(--phcsn-bd2); border-bottom:1px solid var(--phcsn-bd2);
  margin:4px 0 16px;
}
.phcsn-pay-qr img {
  max-width:160px; width:100%; border-radius:10px;
  border:1.5px solid var(--phcsn-bd2); display:block; margin:0 auto 8px;
}
.phcsn-pay-qr p { font-size:12px; color:#9ca3af; margin:0; }

.phcsn-cred-btn {
  display:flex; align-items:center; justify-content:center;
  background:#1a1a2e; color:#fff; padding:12px 20px; border-radius:var(--phcsn-r);
  font-size:15px; font-weight:700; text-decoration:none; margin-top:14px;
  transition:background .15s; font-family:inherit;
  -webkit-tap-highlight-color:transparent;
}
.phcsn-cred-btn:hover { background:#0d0d1f; color:#fff; }

/* ── PATIENT PORTAL ───────────────────────────────────────────── */
.phcsn-portal-wrap {
  max-width:600px; margin:32px auto 40px; padding:0 16px;
  box-sizing:border-box; width:100%;
}
.phcsn-portal-form-box {
  background:#fff; border:1px solid var(--phcsn-bd2);
  border-radius:var(--phcsn-r-lg); padding:30px 32px 32px;
  box-shadow:0 2px 16px rgba(0,0,0,.07); box-sizing:border-box;
}
@media (max-width:560px) { .phcsn-portal-form-box { padding:18px 14px 20px; } }
.phcsn-portal-title { font-size:19px; font-weight:700; color:#111827; margin:0 0 8px; }
.phcsn-portal-row {
  display:flex; gap:10px; margin-top:14px; flex-wrap:wrap;
}
.phcsn-portal-row .phcsn-input { flex:1; min-width:180px; }
.phcsn-portal-row .phcsn-btn {
  font-size:14px; padding:11px 20px; white-space:nowrap;
  flex-shrink:0; width:auto; margin-top:0; box-shadow:none;
}
.phcsn-portal-row .phcsn-btn:hover { transform:none; box-shadow:none; background:var(--phcsn-or2); }

/* Appointment result cards */
.phcsn-appt-card {
  background:#fff; border:1px solid var(--phcsn-bd2); border-left:4px solid var(--phcsn-bd);
  border-radius:var(--phcsn-r-lg); padding:20px 22px; margin-bottom:14px;
  box-shadow:0 1px 6px rgba(0,0,0,.05); box-sizing:border-box;
}
@media (max-width:480px) { .phcsn-appt-card { padding:14px 14px; } }
.phcsn-appt-card--pending   { border-left-color:#f59e0b; }
.phcsn-appt-card--confirmed { border-left-color:var(--phcsn-gn); }
.phcsn-appt-card--completed { border-left-color:#6366f1; }
.phcsn-appt-card--cancelled { border-left-color:#ef4444; }
.phcsn-appt-card__top { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; flex-wrap:wrap; gap:6px; }
.phcsn-appt-card__ref { font-family:monospace; font-size:13px; color:#9ca3af; }
.phcsn-appt-card__body { font-size:14px; color:#4b5563; line-height:2; }
.phcsn-note-box {
  background:#fff8f5; border:1px solid #fed7aa; border-radius:8px;
  padding:10px 14px; margin-top:10px; font-size:13px; color:#4b5563; line-height:1.6;
}
.phcsn-note-box strong {
  display:block; color:var(--phcsn-or); font-size:11px;
  text-transform:uppercase; letter-spacing:.5px; margin-bottom:4px;
}
.phcsn-ex-link {
  display:inline-flex; align-items:center; gap:5px;
  color:var(--phcsn-or); font-size:13px; font-weight:600;
  text-decoration:none; margin-top:10px;
}
.phcsn-ex-link:hover { text-decoration:underline; }

/* ── STATUS PILLS ─────────────────────────────────────────────── */
.phcsn-pill {
  display:inline-flex; padding:3px 11px; border-radius:20px;
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; white-space:nowrap;
}
.phcsn-pill--pending   { background:#fef3c7; color:#92400e; border:1px solid #fde68a; }
.phcsn-pill--confirmed { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.phcsn-pill--completed { background:#ede9fe; color:#4c1d95; border:1px solid #c4b5fd; }
.phcsn-pill--cancelled { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }

/* ── FIELD ERROR MESSAGES ─────────────────────────────────────── */
.phcsn-ferr { color:#ef4444; font-size:11px; display:block; margin-top:3px; }

/* ── PROMINENT QR (booking form payment card) ────────────────── */
.phcsn-pay-qr--prominent {
  text-align: center;
  padding: 20px 0 14px;
  margin-bottom: 18px;
}
.phcsn-pay-qr--prominent img {
  max-width: 200px;
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--phcsn-or);
  display: block;
  margin: 0 auto 10px;
  box-shadow: 0 2px 12px rgba(255,145,90,.15);
}
.phcsn-pay-qr--prominent p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
}

/* ── I'VE PAID SECTION ───────────────────────────────────────── */
.phcsn-paid-section {
  margin-top: 22px;
  border-top: 1px solid var(--phcsn-bd2);
  padding-top: 18px;
}
.phcsn-btn--fullwidth { width: 100%; justify-content: center; }

.phcsn-paid-form {
  margin-top: 14px;
}
.phcsn-paid-form__label {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 8px;
}
.phcsn-file-input {
  display: block;
  width: 100%;
  font-size: 13px;
  color: #374151;
  border: 1.5px dashed var(--phcsn-bd);
  border-radius: var(--phcsn-r);
  padding: 10px 12px;
  background: #fafafa;
  cursor: pointer;
  box-sizing: border-box;
}
.phcsn-file-input:hover { border-color: var(--phcsn-or); background: #fff8f5; }

.phcsn-paid-done {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--phcsn-r);
  padding: 14px 18px;
  margin-top: 14px;
}
.phcsn-paid-done__icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: #22c55e;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.phcsn-paid-done p {
  margin: 0;
  font-size: 14px;
  color: #166534;
  font-weight: 500;
  line-height: 1.4;
}
