/* ============================================================
   Bright Smile — DEMO additions
   Styles for the demo-only features layered on the existing
   design system (tokens from styles.css).
   ============================================================ */

/* demo banner */
.demo-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 90;
  background: var(--grad-warm); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  padding: 4px 14px; border-radius: 0 0 10px 10px; box-shadow: var(--shadow-sm); }

/* welcome demo card */
.demo-cred { background: #f2fbf9; border: 1.5px dashed #9fd8c9; border-radius: var(--radius-lg);
  padding: 12px 14px; margin: 14px 0 0; text-align: left; }
.demo-cred .cred-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; }
.demo-cred .cred-row code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 12px; }
.demo-cred .cred-label { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-bottom: 4px; }

/* dentist photo avatar */
.dent-photo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, var(--shadow-sm); flex: none; }
.dent-photo.lg { width: 72px; height: 72px; }

/* services grid */
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc-tile { background: var(--chip); border-radius: var(--radius-lg); padding: 12px; cursor: pointer; transition: transform .12s ease; }
.svc-tile:active { transform: scale(.96); }
.svc-tile .e { font-size: 22px; }
.svc-tile b { display: block; font-size: 13.5px; margin-top: 4px; }
.svc-tile span { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; line-height: 1.35; }
.svc-tile .p { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--brand); }

/* AI receptionist chat */
.ai-wrap { display: flex; flex-direction: column; height: calc(100dvh - 260px); min-height: 380px; }
.ai-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.ai-msg { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-line; }
.ai-msg.bot { background: var(--chip); border-bottom-left-radius: 4px; align-self: flex-start; }
.ai-msg.me { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.ai-quick button { border: 1.5px solid var(--brand); color: var(--brand); background: #fff; border-radius: 999px;
  padding: 7px 13px; font-size: 13px; font-weight: 600; }
.ai-input { display: flex; gap: 8px; }
.ai-input input { flex: 1; }
.ai-disclaimer { font-size: 11.5px; color: var(--muted); text-align: center; padding-top: 6px; }
.ai-typing { align-self: flex-start; color: var(--muted); font-size: 13px; padding: 4px 2px; }

/* treatment journey */
.j-bar { height: 10px; background: var(--chip); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.j-bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.j-step { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.j-step:last-child { border-bottom: none; }
.j-step .ico { width: 30px; height: 30px; border-radius: 10px; background: var(--mint); display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; }
.j-step b { display: block; font-size: 13.5px; }
.j-step span { color: var(--muted); font-size: 12.5px; }

/* emergency sheet */
.emg-actions { display: grid; gap: 10px; margin-top: 10px; }
.emg-actions a { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px;
  border-radius: var(--radius-lg); font-weight: 700; text-decoration: none; font-size: 15px; }
.emg-call { background: var(--danger); color: #fff; }
.emg-wa { background: #25d366; color: #fff; }

/* reviews */
.stars { display: flex; gap: 6px; font-size: 30px; cursor: pointer; }
.stars span { color: #d4dce3; transition: color .1s; }
.stars span.on { color: var(--gold); }

/* info page (pre-login) */
#infoPage { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch; }
#infoPage .info-body { flex: 1; padding: 8px 22px 18px; max-width: 520px; width: 100%; margin: 0 auto; }
#infoPage h1 { font-size: 30px; line-height: 1.12; margin: 12px 0 8px; color: var(--ink); }
#infoPage .info-body > p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
#infoPage .wel-cta { padding: 14px 22px calc(18px + env(safe-area-inset-bottom)); max-width: 520px; width: 100%; margin: 0 auto; }
#infoPage .wel-cta button { width: 100%; }
button.cta-red, .cta-red { background: linear-gradient(135deg, #f2545b 0%, #d63a44 100%) !important;
  color: #fff !important; box-shadow: 0 10px 24px rgba(242, 84, 91, 0.38); }
.info-accordion { display: grid; gap: 10px; }
.info-acc { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.info-acc summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 10px; user-select: none; }
.info-acc summary::-webkit-details-marker { display: none; }
.info-acc .acc-icon { font-size: 18px; }
.info-acc .acc-chev { margin-left: auto; color: var(--muted); transition: transform .18s ease; }
.info-acc[open] .acc-chev { transform: rotate(180deg); }
.info-acc ul { margin: 0; padding: 2px 16px 14px 16px; list-style: none; }
.info-acc li { display: flex; gap: 10px; padding: 6px 0; font-size: 13.5px; color: var(--ink); line-height: 1.4; border-top: 1px solid var(--line); }
.info-acc li:first-child { border-top: none; }
.info-acc li span { flex: none; }

/* inquiry list (admin) */
.iq-status { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; }
.iq-status.new { background: #fdf0d5; color: var(--warn); }
.iq-status.done { background: #e3f6ec; color: var(--ok); }

/* owner dashboard bars */
.obar-row { display: grid; grid-template-columns: 150px 1fr 34px; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.obar { height: 14px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.obar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.obar-row .n { text-align: right; font-weight: 800; }

/* metric tiles */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.metric { background: var(--card); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-sm); text-align: left; }
.metric .n { font-size: 26px; font-weight: 800; color: var(--ink); }
.metric .k { font-size: 12px; color: var(--muted); margin-top: 2px; }
.metric .trend { font-size: 11.5px; font-weight: 700; margin-top: 6px; display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e3f6ec; color: var(--ok); }
.metric .trend.down { background: #fbe9e7; color: var(--danger); }
.metric .trend.flat { background: #e7f0fb; color: #0d5aa8; }

@media (max-width: 560px) {
  .obar-row { grid-template-columns: 110px 1fr 30px; }
}

/* ============================================================
   Role switcher — Patient (red) / Dentist (blue)
   Sits just above the main menu on both the patient app and the
   owner dashboard so testers can jump between roles in one tap.
   ============================================================ */
.role-switch { display: flex; gap: 10px; margin: 6px auto 12px; max-width: 520px; width: 100%; }
.role-switch button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 14px; font-size: 14px; font-weight: 800; border-radius: 999px; color: #fff !important;
  border: 2px solid transparent; transition: transform .12s, box-shadow .2s, opacity .2s; }
.role-switch .rs-patient { background: linear-gradient(135deg, #f2545b 0%, #d63a44 100%) !important; box-shadow: 0 8px 18px rgba(242,84,91,.32); }
.role-switch .rs-dentist { background: linear-gradient(135deg, #3a95f0 0%, #1060d0 100%) !important; box-shadow: 0 8px 18px rgba(24,120,230,.32); }
.role-switch button:not(.on) { opacity: .72; box-shadow: none; }
.role-switch button.on { border-color: #fff; outline: 2px solid currentColor; outline-color: rgba(14,44,71,.18); }
.role-switch button:active { transform: scale(.97); }
.role-switch .rs-now { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255,255,255,.25); padding: 2px 7px; border-radius: 999px; }
body.admin .role-switch { max-width: none; margin: 4px 0 14px; }

/* welcome screen: red Patient / blue Dentist buttons + readable labels */
#welcome .demo-cred .cred-row span { color: var(--ink, #0e2c47); font-weight: 700; }
#welcome #welDemo { background: linear-gradient(135deg, #f2545b 0%, #d63a44 100%); color: #fff; box-shadow: 0 10px 24px rgba(242,84,91,.38); }
#welcome #welOwner { background: linear-gradient(135deg, #3a95f0 0%, #1060d0 100%); color: #fff; box-shadow: 0 10px 24px rgba(24,120,230,.38); }
#welcome .demo-cred .cred-row { align-items: center; }
#welcome .demo-cred .cred-row code { color: var(--ink, #0e2c47); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
