/* =====================================================================
   Hôpital EPC de Djoungolo - prise de rendez-vous
   Concept : la carte de consultation de l'hôpital - bleu institutionnel
   du logo, vert d'espérance, et le bleu clair du ruban Novembre Bleu.
   ===================================================================== */
:root {
  --epc-navy: #173f78;     /* logo: wordmark */
  --epc-blue: #1d5fb0;
  --nb: #1e88e5;           /* Novembre Bleu ribbon */
  --nb-soft: #e7f2fd;
  --epc-green: #1f8a3b;    /* logo: hands */
  --epc-gold: #f2b632;     /* logo: rays */
  --epc-red: #d32f2f;      /* logo: cross */
  --ink: #15233a;
  --muted: #5c6b80;
  --line: #e2e8f0;
  --paper: #f5f8fc;
  --white: #ffffff;
  --f-title: "Merriweather", Georgia, "Times New Roman", serif;
  --f-body: "Nunito Sans", "Segoe UI", Roboto, Arial, sans-serif;
}
body.pub, body.admin { font-family: var(--f-body); color: var(--ink); }
body.pub { background: var(--paper); }
.pub .content-wrapper { background: var(--paper); }
:focus-visible { outline: 3px solid var(--epc-gold) !important; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- public header */
.pub-nav { border-bottom: 1px solid var(--line) !important; padding-top: max(.5rem, env(safe-area-inset-top, 0px)); position: sticky; top: 0; z-index: 1030; }
.pub-brand { display: flex; align-items: center; gap: 10px; }
.pub-brand img { border-radius: 50%; }
.pub-brand span { display: flex; flex-direction: column; line-height: 1.05; color: var(--epc-navy); font-family: var(--f-title); font-size: 1rem; }
.pub-brand small { font-family: var(--f-body); font-size: .78rem; color: var(--epc-green); font-weight: 700; letter-spacing: .02em; }
.pub-nav .nav-link { font-weight: 700; color: var(--muted) !important; }
.pub-nav .nav-link.active, .pub-nav .nav-link:hover { color: var(--epc-navy) !important; }
.btn-nb { background: var(--nb); color: #fff !important; border: 0; font-weight: 700; }
.btn-nb:hover { background: #1565c0; }
.btn-epc { background: var(--epc-navy); color: #fff !important; font-weight: 700; }
.btn-epc:hover { background: #0f2f5d; }
.pub-content { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) { .pub-content { padding-bottom: 0; } }
.pub-footer { font-size: .88rem; color: var(--muted); }
.pub-footer .container { gap: 8px; }

/* ---------- bottom tab bar (mobile app feel) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  box-shadow: 0 -6px 18px rgba(23, 63, 120, .08); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 0; border-radius: 10px; }
.tabbar a i { font-size: 1.15rem; }
.tabbar a.on { color: var(--epc-navy); background: var(--nb-soft); }

/* ---------- hero Novembre Bleu */
.nb-hero { background: linear-gradient(160deg, #0d2f5c 0%, var(--epc-navy) 45%, #1565c0 100%); color: #fff; position: relative; overflow: hidden; }
.nb-hero::after { content: ""; position: absolute; right: -60px; top: -40px; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 182, 50, .35), transparent 65%); pointer-events: none; }
.nb-hero .container { position: relative; z-index: 1; padding-top: 42px; padding-bottom: 46px; }
.nb-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  padding: 6px 14px; border-radius: 30px; font-weight: 700; font-size: .85rem; letter-spacing: .03em; }
.nb-hero h1 { font-family: var(--f-title); font-weight: 900; font-size: clamp(1.9rem, 5vw, 3.1rem); line-height: 1.12; margin: 16px 0 12px; text-wrap: balance; }
.nb-hero h1 span { color: #90caf9; }
.nb-hero p.lead { color: #d6e6f8; max-width: 38em; font-size: 1.12rem; }
.nb-dates { font-weight: 800; color: var(--epc-gold); letter-spacing: .02em; }
.ribbon { width: 150px; max-width: 100%; }
.nb-hero .btn { font-weight: 800; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- sections */
.sec { padding: 40px 0; }
.sec-title { font-family: var(--f-title); color: var(--epc-navy); font-weight: 900; font-size: clamp(1.4rem, 3vw, 1.9rem); text-wrap: balance; }
.sec-sub { color: var(--muted); max-width: 44em; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 800; color: var(--epc-green); }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; height: 100%; }
.tile .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--nb-soft); color: var(--nb); font-size: 1.25rem; margin-bottom: 12px; }
.tile h3 { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.tile p { color: var(--muted); font-size: .93rem; margin: 0; }
.symptoms { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.symptoms li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.symptoms li i { color: var(--nb); margin-top: 3px; }
.steps3 { counter-reset: s; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767px) { .steps3 { grid-template-columns: 1fr; } }
.steps3 > div { background: #fff; border-radius: 16px; border: 1px solid var(--line); padding: 18px; position: relative; }
.steps3 > div::before { counter-increment: s; content: counter(s); position: absolute; top: -12px; left: 16px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--epc-navy); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.svc-price { font-weight: 800; color: var(--epc-navy); }
.tag-nb { background: var(--nb-soft); color: #0d5aa7; font-weight: 800; font-size: .72rem; padding: 3px 9px; border-radius: 20px; letter-spacing: .02em; }
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.info-list li { display: flex; gap: 12px; }
.info-list i { width: 22px; color: var(--epc-green); margin-top: 4px; }
.copy-num { font-weight: 800; font-size: 1.1rem; color: var(--epc-navy); user-select: all; }

/* ---------- booking wizard */
.wizard { max-width: 860px; margin: 0 auto; padding: 18px 12px 30px; }
.wiz-steps { display: flex; gap: 6px; margin: 4px 0 16px; }
.wiz-steps span { flex: 1; height: 6px; border-radius: 6px; background: #d9e3ef; transition: background .2s; }
.wiz-steps span.on { background: var(--nb); }
.wiz-title { font-family: var(--f-title); font-weight: 900; color: var(--epc-navy); font-size: 1.35rem; margin: 0 0 4px; }
.wiz-sub { color: var(--muted); margin-bottom: 14px; }
.wiz-card { background: #fff; border-radius: 18px; border: 1px solid var(--line); padding: 16px; box-shadow: 0 6px 20px rgba(23,63,120,.06); }
.opt-list { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; transition: border-color .15s, background .15s; color: var(--ink); }
.opt:hover { border-color: #9cc6f2; }
.opt.sel { border-color: var(--nb); background: #f3f9ff; }
.opt .av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--nb-soft); color: var(--nb); font-weight: 800; overflow: hidden; }
.opt .av img { width: 100%; height: 100%; object-fit: cover; }
.opt .t { font-weight: 800; }
.opt .d { color: var(--muted); font-size: .88rem; }
.opt .r { margin-left: auto; text-align: right; flex-shrink: 0; font-size: .85rem; }
.opt-group { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 12px 2px 2px; }
.wiz-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 16px; }
.wiz-nav .btn { min-height: 48px; border-radius: 12px; font-weight: 800; padding-left: 20px; padding-right: 20px; }
.sticky-cta { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
@media (min-width: 768px) { .sticky-cta { bottom: 12px; } }

/* calendar */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { font-size: 1.05rem; text-transform: capitalize; }
.cal-head button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.cal-head button:disabled { opacity: .35; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-grid .wd { text-align: center; font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal-day { aspect-ratio: 1 / 1; border-radius: 12px; border: 1px solid transparent; background: #f1f4f8; color: #9aa6b5; font-weight: 700; position: relative; display: grid; place-items: center; font-size: .95rem; padding: 0; }
.cal-day.free { background: #eaf4ff; color: var(--epc-navy); border-color: #cfe4fb; cursor: pointer; }
.cal-day.free::after { content: ""; position: absolute; bottom: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--epc-green); }
.cal-day.few::after { background: var(--epc-gold); }
.cal-day.free:hover { border-color: var(--nb); }
.cal-day.sel { background: var(--nb); color: #fff; border-color: var(--nb); }
.cal-day.sel::after { background: #fff; }
.cal-day.today { box-shadow: inset 0 0 0 2px #b8c7d9; }
.cal-day.empty { background: transparent; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 8px; }
.cal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.slots-title { font-weight: 800; margin: 16px 0 8px; }
.slot-group { font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 6px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { border: 2px solid #cfe4fb; background: #fff; border-radius: 12px; padding: 10px 0; font-weight: 800; color: var(--epc-navy); font-variant-numeric: tabular-nums; }
.slot:hover { border-color: var(--nb); }
.slot.sel { background: var(--nb); border-color: var(--nb); color: #fff; }
.slots-empty { color: var(--muted); padding: 14px; text-align: center; background: #f6f8fb; border-radius: 12px; }
.recap { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; }
.recap dt { color: var(--muted); font-weight: 600; }
.recap dd { margin: 0; font-weight: 700; }
.success-ic { width: 76px; height: 76px; border-radius: 50%; background: #e3f5e9; color: var(--epc-green); display: grid; place-items: center; font-size: 2.2rem; margin: 0 auto 12px; }
.ref-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.25rem; font-weight: 800; letter-spacing: .06em; color: var(--epc-navy); background: var(--nb-soft); padding: 6px 14px; border-radius: 10px; display: inline-block; user-select: all; }
.form-control-lg, .custom-select-lg { border-radius: 12px; }
.pub .form-control { border-radius: 10px; min-height: 46px; }
.pub label { font-weight: 700; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; border: 2px solid var(--line); border-radius: 12px; padding: 10px; font-weight: 800; cursor: pointer; }
.seg input:checked + span { border-color: var(--nb); background: #f3f9ff; color: var(--epc-navy); }
.seg input:focus-visible + span { outline: 3px solid var(--epc-gold); }

/* patient appointments */
.appt { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 8px; }
.appt.past { opacity: .72; }
.appt .when { font-weight: 800; font-size: 1.05rem; color: var(--epc-navy); }
.appt .when::first-letter, .slots-title::first-letter { text-transform: uppercase; }
.appt .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.appt .actions .btn { border-radius: 10px; font-weight: 700; }

/* toasts */
.toast-zone { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 2000; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 768px) { .toast-zone { left: auto; right: 20px; bottom: 20px; justify-items: end; } }
.toast-msg { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 26px rgba(0,0,0,.2); max-width: 420px; pointer-events: auto; font-weight: 600; }
.toast-msg.err { background: #b3261e; } .toast-msg.ok { background: var(--epc-green); }

/* ---------- admin */
body.admin { background: #f4f6f9; }
.admin .brand-link { display: flex; align-items: center; gap: 8px; }
.admin .brand-link img { border-radius: 50%; background: #fff; }
.admin .main-sidebar { background: #0f2f5d; }
.admin .nav-sidebar .nav-link.active { background: var(--nb) !important; }
.admin .content-header h1 { font-family: var(--f-title); font-weight: 900; color: var(--epc-navy); font-size: 1.5rem; }
.admin .small-box { border-radius: 14px; }
.admin .card { border-radius: 14px; }
.admin .table td, .admin .table th { vertical-align: middle; }
.admin .fc { --fc-border-color: #e3e8ef; --fc-today-bg-color: #f0f7ff; font-size: .9rem; }
.admin .fc .fc-event { cursor: pointer; border-radius: 6px; }
.admin .fc .fc-toolbar-title { font-size: 1.15rem; text-transform: capitalize; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.timeline-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.timeline-mini li { border-left: 3px solid var(--line); padding-left: 12px; }
.timeline-mini li.doctor { border-left-color: var(--epc-gold); }
.timeline-mini li.patient { border-left-color: var(--nb); }
.timeline-mini li.admin, .timeline-mini li.secretary { border-left-color: var(--epc-green); }
.today-list .list-group-item { display: flex; gap: 12px; align-items: center; }
.today-list .hour { font-weight: 800; font-variant-numeric: tabular-nums; width: 52px; color: var(--epc-navy); }
.login-page { background: linear-gradient(160deg, #0d2f5c, #1565c0); }
.login-box .card { border-radius: 18px; }
@media (max-width: 575px) { .admin .content-header h1 { font-size: 1.25rem; } .admin .btn-toolbar-sm .btn { padding: .25rem .5rem; } }

/* SlotPicker: calendar and slots side by side on wide screens */
.sp .cal { max-width: 420px; }
@media (min-width: 768px) {
  .sp { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .sp .slots-zone .slots-title { margin-top: 4px; }
  .sp .cal-day { font-size: .9rem; border-radius: 10px; }
}
