/* Dentoderm booking, direction A "Arch and clay".
   Tones from the clinic's blush marble and terracotta logo wall; warm dark lines; serif headings. */
:root {
  --stone: #F2E8E3;       /* blush marble: page background */
  --paper: #FBF8F6;       /* surfaces */
  --white: #FFFFFF;
  --sand: #E6D5CC;        /* lines and quiet fills */
  --clay: #B06A54;        /* logo-wall terracotta: actions */
  --clay-deep: #8E4F3C;
  --clay-soft: #F4E4DC;
  --ink: #2E2623;         /* warm dark line */
  --muted: #7D6C65;
  --ok: #5E7B5A;
  --ok-soft: #E6EEE3;
  --alert: #A8433A;
  --alert-soft: #F8E3DF;
  --warn-soft: #FBEFE2;
  --radius: 12px;
  --serif: "Didot", "Bodoni 72", "Bodoni Moda", "Playfair Display", Georgia, serif;
  --sans: "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--stone);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; font-size: 15px; }
a { color: var(--clay-deep); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; }
.wordmark { font-family: var(--serif); font-size: 19px; letter-spacing: .32em; line-height: 1; }
.wordmark small { display: block; font-family: var(--sans); font-size: 9.5px; letter-spacing: .28em; margin-top: 5px; color: var(--muted); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 24px; background: var(--paper); border-bottom: 1px solid var(--sand); }
.topbar .grow { flex: 1; }
.daynav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.daynav h1 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 6px; white-space: nowrap; min-width: 12ch; text-align: center; }
.round { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--sand); background: transparent; color: var(--ink); font-size: 17px; cursor: pointer; line-height: 1; }
.round:hover, .pill:hover { background: var(--stone); }
.pill { border: 1px solid var(--sand); border-radius: 999px; padding: 6px 14px; background: transparent; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--sand); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 999px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.select-pill { width: auto; border: 1px solid var(--sand); border-radius: 999px; padding: 7px 30px 7px 14px; background-color: var(--paper); font: inherit; font-size: 14px; color: var(--ink);
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.who { color: var(--muted); font-size: 13px; text-align: right; line-height: 1.25; }
.who b { color: var(--ink); font-weight: 600; display: block; }
.usermenu { display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.usermenu form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--clay-deep); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- buttons ---------- */
.btn { display: inline-block; margin-top: 1.2rem; width: 100%; padding: .75rem 1rem; background: var(--clay); color: #fff; border: 0; border-radius: 999px; font: 600 15px var(--sans); cursor: pointer; }
.btn:hover, .btn-book:hover, .btn-small:hover { background: var(--clay-deep); }
.btn.danger { background: var(--alert); }
.btn-book { white-space: nowrap; background: var(--clay); color: #fff; border: 0; border-radius: 999px; padding: 9px 20px; font: 600 14px var(--sans); cursor: pointer; }
.btn-small { padding: 5px 14px; border-radius: 999px; border: 0; background: var(--clay); color: #fff; font: 600 13px var(--sans); cursor: pointer; }
.btn-dark { padding: 5px 13px; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); font: 600 12.5px var(--sans); cursor: pointer; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: .9rem 0 .3rem; }
input[type=text], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; padding: .6rem .8rem; border: 1px solid var(--sand); border-radius: 10px; font: inherit; background: var(--white); color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--clay); outline-offset: 0; border-color: var(--clay); }
.errors { color: var(--alert); margin: .6rem 0 0; padding-left: 1.1rem; }
ul.errorlist { color: var(--alert); margin: .25rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.errors-box { padding: .6rem .8rem; background: var(--alert-soft); color: var(--alert); border-radius: 10px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; margin: 0; }

/* ---------- pages ---------- */
main { padding: 22px 24px 28px; }
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .6rem .9rem; border-radius: 10px; background: var(--ok-soft); color: var(--ok); }

/* login, 2FA, no access: a card with an arch top */
.card { background: var(--paper); border: 1px solid var(--sand); border-radius: 220px 220px var(--radius) var(--radius);
  padding: 4.2rem 2.2rem 2rem; max-width: 430px; margin: 4vh auto; }
.card .brand { justify-content: center; flex-direction: column; text-align: center; gap: 14px; margin-bottom: 1.6rem; }
.card .brand svg { width: 52px; height: 52px; }
.card h1 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: 0 0 .3rem; text-align: center; }
.card p.lead { color: var(--muted); margin: 0 0 1.2rem; text-align: center; }
.qr { display: flex; justify-content: center; margin: 1rem 0; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 10px; padding: 6px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; word-break: break-all; background: var(--stone); padding: .45rem .65rem; border-radius: 8px; }
.steps { padding-left: 1.2rem; color: var(--muted); }

/* ---------- calendar page ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.cal-card { background: var(--paper); border-radius: var(--radius); padding: 0 12px 12px; }
#ec { height: calc(100vh - 124px); min-height: 560px; }
.side { display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 124px); overflow: auto; }
.panel { background: var(--paper); border-radius: var(--radius); padding: 18px 18px 8px; }
.panel h2 { font-family: var(--serif); font-weight: 400; font-size: 21px; margin: 0 0 4px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel .sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.count { font-family: var(--sans); font-size: 12px; color: #fff; background: var(--clay); border-radius: 999px; padding: 1px 8px; }
@media (max-width: 1000px) {
  .cal-layout { grid-template-columns: 1fr; }
  #ec { height: 72vh; }
  .side { max-height: none; }
  .daynav h1 { font-size: 21px; min-width: 0; }
}

/* EventCalendar, themed (".cal-card .ec" so it wins over the library's own stylesheet, which loads later) */
.cal-card .ec {
  --ec-bg-color: var(--paper);
  --ec-border-color: var(--sand);
  --ec-text-color: var(--ink);
  --ec-today-bg-color: transparent;
  --ec-highlight-color: var(--clay-soft);
  --ec-now-indicator-color: var(--clay);
  --ec-event-bg-color: var(--white);
  --ec-event-text-color: var(--ink);
  --ec-bg-event-opacity: 1;
  font-family: var(--sans);
}
/* the arch: the one brand gesture */
.arch { margin: 14px 6px 0; padding: 18px 6px 10px; border-radius: 999px 999px 0 0; background: var(--stone); border: 1px solid var(--sand); border-bottom: 0; text-align: center; }
.arch .name { font-family: var(--serif); font-size: 18px; }
.arch .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 2px; }
.ec-week-view .arch { padding: 12px 4px 8px; margin: 8px 3px 0; }
.ec-week-view .arch .name { font-size: 14px; }

.cal-card .ec .ec-event { border-radius: 10px; border: 1px solid var(--sand); box-shadow: 0 6px 14px -10px rgba(70, 40, 30, .55); cursor: pointer; overflow: hidden; }
.cal-card .ec .ec-event::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--clay)); }
.cal-card .ec .ec-event.st-done { opacity: .55; }
.cal-card .ec .ec-event.st-no_show { opacity: .7; }
.cal-card .ec .ec-event.st-no_show .appt-name { text-decoration: line-through; }
.cal-card .ec .ec-event.overlap { outline: 1.5px dashed var(--alert); outline-offset: -2px; }
.appt-card { padding: 4px 6px 4px 9px; font-size: 12.5px; line-height: 1.3; }
.appt-time { color: var(--muted); font-size: 11.5px; }
.appt-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.appt-what { color: var(--muted); }
.tag { font-size: 10.5px; font-weight: 500; padding: 0 7px; border-radius: 999px; background: var(--stone); color: var(--muted); white-space: nowrap; }
.tag.here { background: var(--ok-soft); color: var(--ok); }
.tag.bot { background: var(--clay-soft); color: var(--clay-deep); }
.cal-card .ec .ec-bg-event.offhours { background: repeating-linear-gradient(135deg, rgba(125,108,101,.08) 0 6px, transparent 6px 12px) !important; }
.cal-card .ec .ec-bg-event.timeoff { background: rgba(230, 213, 204, .6) !important; }

/* side panel content */
.req, .msg { border-top: 1px solid var(--sand); padding: 12px 0; }
.req-main { display: flex; flex-direction: column; }
.req-main strong, .msg-head strong { font-weight: 600; }
.req-meta { font-size: 12.5px; margin-top: 2px; color: var(--muted); }
.req-actions { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.msg-head { font-size: 14px; }
.msg-body { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--stone); border-radius: 10px; padding: .55rem .7rem; margin: .5rem 0; max-height: 11rem; overflow: auto; }
.msg.failed .msg-head strong { color: var(--alert); }
.failed-title { font-family: var(--serif); font-weight: 400; font-size: 17px; margin: .6rem 0 .2rem; color: var(--alert); }
.empty { color: var(--muted); font-size: 14px; padding: 4px 0 12px; margin: 0; }

/* dialog */
dialog#modal { border: 0; border-radius: 16px; padding: 1.6rem 1.8rem; width: min(640px, 94vw); max-height: 90vh; overflow: auto;
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(70, 40, 30, .45); }
dialog#modal::backdrop { background: rgba(46, 38, 35, .35); }
dialog#modal h2 { font-family: var(--serif); font-weight: 400; margin: 0 0 .7rem; font-size: 1.6rem; }
dialog#modal h3 { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; margin: 1.3rem 0 .4rem; }
.close { position: absolute; right: .9rem; top: .6rem; border: 0; background: none; font-size: 1.7rem; cursor: pointer; color: var(--muted); }
.form fieldset { border: 1px solid var(--sand); border-radius: 12px; padding: .4rem 1rem 1rem; margin: 0 0 .4rem; }
.form legend { font-weight: 600; padding: 0 .35rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 .9rem; }
.row-tight { display: flex; gap: .5rem; align-items: center; }
.results { list-style: none; margin: .3rem 0; padding: 0; border: 1px solid var(--sand); border-radius: 10px; background: var(--white); }
.results li + li { border-top: 1px solid var(--sand); }
.results button { width: 100%; text-align: left; background: none; border: 0; padding: .55rem .8rem; cursor: pointer; font: inherit; color: var(--ink); }
.results button:hover { background: var(--stone); }
.picked { margin: .6rem 0; padding: .55rem .8rem; background: var(--clay-soft); border-radius: 10px; }
.clash { margin-top: 1rem; padding: .85rem 1rem; border-radius: 12px; background: var(--warn-soft); border: 1px solid #EBC9A6; }
.clash p { margin: 0 0 .5rem; }
.status-line { margin: 0 0 .9rem; color: var(--muted); }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; margin-right: .4rem; background: var(--stone); color: var(--muted); }
.badge.st-confirmed { background: var(--clay-soft); color: var(--clay-deep); }
.badge.st-arrived, .badge.msg-sent { background: var(--ok-soft); color: var(--ok); }
.badge.st-no_show, .badge.st-cancelled, .badge.msg-failed { background: var(--alert-soft); color: var(--alert); }
.badge.msg-held { background: var(--warn-soft); color: #8A5A00; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: 0 0 .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0; }
.cancel { margin-top: .9rem; }
.cancel summary { cursor: pointer; color: var(--alert); }
.history { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.history li { padding: .3rem 0; border-top: 1px solid var(--sand); }
.history li:first-child { border-top: 0; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(16px); background: var(--ink); color: var(--paper);
  padding: .75rem 1.2rem; border-radius: 999px; transition: transform .25s, opacity .25s; max-width: min(600px, 92vw); z-index: 50;
  opacity: 0; visibility: hidden; font-size: 14px; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
#toast.bad { background: var(--alert); }
/* Day view: the date is already in the top bar, so hide the library's date row above the arches. */
.cal-card .ec-day-view .ec-header .ec-col-group { display: none; }

/* ---------- phone ---------- */
.doctor-tabs { display: none; }
@media (max-width: 700px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar .grow { display: none; }
  .topbar .wordmark, .topbar .who, .topbar #doctor-filter, .topbar a[href*="admin"] { display: none; }
  .daynav { order: 2; width: 100%; justify-content: center; gap: 8px; }
  .daynav #prev { order: 1; } .daynav h1 { order: 2; } .daynav #next { order: 3; }
  .daynav #today { order: 4; } .daynav .seg { order: 5; }
  .daynav h1 { font-size: 21px; flex: 1 1 calc(100% - 92px); min-width: 0; margin: 0; }
  .cal-card .ec-header { display: none; }
  .usermenu { margin-left: auto; }
  .btn-book { order: 3; width: 100%; padding: 11px; font-size: 15px; }
  main { padding: 12px 12px 20px; }
  .doctor-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
  .doctor-tabs button { border: 1px solid var(--sand); border-radius: 999px; padding: 6px 14px; background: var(--paper); font: inherit; font-size: 14px; color: var(--muted); white-space: nowrap; cursor: pointer; }
  .doctor-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  #ec { height: 70vh; min-height: 0; }
  .cal-card { padding: 0 6px 6px; }
  .arch { margin: 10px 18% 0; padding: 14px 6px 8px; }
}
