/* Termini – standalone pages (staff app + booking page). Mobile first. */
:root { --p: #2f6f73; --ink: #1f2a2b; --muted: #66727a; --line: #e3e7e8; --soft: #f5f7f7; --bg: #f1f3f3; --warn-bg: #fff4d6; --warn: #7a5a00; --ok-bg: #e7f3ef; --ok: #1d5b45; --bad-bg: #f6e3e3; --bad: #8a2c2c; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.45; }
body.stf-noscroll { overflow: hidden; }
a { color: var(--p); }
button { font: inherit; }

/* top bar */
.stf-top, .pg-top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--p); color: #fff; }
.stf-clinic, .pg-clinic { font-weight: 700; font-size: 16px; }
.stf-user { font-size: 13px; opacity: .85; }
.stf-logout, .pg-back { color: #fff; font-size: 14px; text-decoration: none; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; padding: 6px 10px; white-space: nowrap; }

.stf-main { max-width: 720px; margin: 0 auto; padding: 14px 16px 96px; transition: opacity .15s; }
.stf-main.is-busy { opacity: .6; }
.stf-h1 { font-size: 20px; margin: 4px 0 10px; }
.stf-h2 { font-size: 16px; margin: 22px 0 8px; }
.stf-muted { color: var(--muted); }
.stf-small { font-size: 14px; }

/* day navigation */
.stf-daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.stf-arrow { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 26px; line-height: 1; color: var(--ink); cursor: pointer; flex: none; }
.stf-daylabel { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stf-daylabel strong { font-size: 17px; }
.stf-today { font-size: 12px; background: var(--ok-bg); color: var(--ok); padding: 1px 8px; border-radius: 10px; font-weight: 700; }
.stf-link { background: none; border: 0; color: var(--p); font-weight: 600; font-size: 14px; padding: 2px; text-decoration: underline; cursor: pointer; }
.stf-datepick { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 8px 2px; font-size: 14px; }
.stf-date { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }

.stf-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.stf-chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 14px; font-size: 15px; color: var(--ink); cursor: pointer; }
.stf-chip.is-on { background: var(--p); border-color: var(--p); color: #fff; }
.stf-hours { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 2px 2px 10px; }
.stf-hour b { color: var(--ink); font-weight: 600; }
.stf-count { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 6px 2px 8px; }
.stf-wait { font-size: 12px; background: var(--warn-bg); color: var(--warn); padding: 2px 8px; border-radius: 10px; }
.stf-empty { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); }

/* booking cards */
.stf-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--p); border-radius: 12px; padding: 12px; margin-bottom: 8px; color: inherit; cursor: pointer; }
.stf-card.stf-booked { border-left-color: #dba617; }
.stf-card.stf-cancelled { opacity: .55; border-left-color: #c3c4c7; }
.stf-card.stf-cancelled .stf-svc { text-decoration: line-through; }
.stf-card.is-past { opacity: .7; }
.stf-time { display: flex; flex-direction: column; min-width: 50px; }
.stf-time strong { font-size: 18px; }
.stf-time span { font-size: 13px; color: var(--muted); }
.stf-info { flex: 1; min-width: 0; }
.stf-svc { font-weight: 600; font-size: 15px; }
.stf-pt { font-size: 15px; }
.stf-doc { font-size: 13px; color: var(--muted); }
.stf-badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.stf-b-booked { background: var(--warn-bg); color: var(--warn); }
.stf-b-confirmed { background: var(--ok-bg); color: var(--ok); }
.stf-b-cancelled { background: var(--bad-bg); color: var(--bad); }

/* bottom sheet */
.stf-overlay { position: fixed; inset: 0; background: rgba(20, 30, 30, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.stf-sheet { background: #fff; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.15); }
@media (min-width: 700px) { .stf-overlay { align-items: center; } .stf-sheet { border-radius: 18px; } }
.stf-sheet-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.stf-sheet-head strong { font-size: 17px; }
.stf-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); font-size: 24px; line-height: 1; cursor: pointer; flex: none; color: var(--ink); }
.stf-dl { display: grid; grid-template-columns: 82px 1fr; gap: 6px 10px; margin: 0 0 14px; }
.stf-dl dt { color: var(--muted); }
.stf-dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.stf-actions { display: grid; gap: 8px; }
.stf-btn { display: block; width: 100%; text-align: center; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; }
.stf-btn:disabled { opacity: .6; }
.stf-primary { background: var(--p); border-color: var(--p); color: #fff; }
.stf-call { background: var(--ok-bg); border-color: #b6dccd; color: var(--ok); }
.stf-danger { color: var(--bad); border-color: #e6bcbc; }
.stf-danger-solid { background: #9a3b3b; border-color: #9a3b3b; color: #fff; }
.stf-sm { padding: 8px 12px; font-size: 14px; width: auto; }
.stf-confirm { background: var(--bad-bg); border-radius: 12px; padding: 12px; }
.stf-confirm p { margin: 0 0 10px; color: var(--bad); }
.stf-row { display: flex; gap: 8px; }
.stf-row > * { flex: 1; }
.stf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* forms */
.stf-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stf-form { display: grid; gap: 12px; }
.stf-field span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.stf-field input, .stf-select { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #cfd6d8; border-radius: 10px; background: #fff; color: var(--ink); min-height: 46px; }
.stf-win { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.stf-del { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #e6bcbc; background: #fff; color: var(--bad); font-size: 22px; cursor: pointer; flex: none; }
.stf-error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; margin: 8px 0; }
.stf-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #1f2a2b; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.2); }

/* bottom nav */
.stf-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: 1fr 1fr 1fr; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.stf-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.stf-nav-item .stf-ico { font-size: 20px; line-height: 1.1; }
.stf-nav-item.is-on { color: var(--p); }
.stf-nav-item:nth-child(2) .stf-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--p); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; }

.stf-embed .trm-card { padding: 16px; }
.trm-movebox { background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.trm-block-btn { width: 100%; }

/* login */
.stf-login { max-width: 420px; margin: 28px auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.stf-login h1 { font-size: 20px; margin: 0 0 4px; }
.stf-login form p { margin: 0 0 12px; }
.stf-login label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.stf-login input[type=text], .stf-login input[type=password] { width: 100%; font: inherit; padding: 12px; border: 1px solid #cfd6d8; border-radius: 10px; min-height: 48px; }
.stf-login .login-remember label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.stf-login input[type=submit] { width: 100%; background: var(--p); color: #fff; border: 0; border-radius: 12px; padding: 14px; font: inherit; font-weight: 700; cursor: pointer; }
.stf-forgot { display: block; text-align: center; margin-top: 12px; font-size: 14px; }

/* standalone booking page */
.pg-main { max-width: 760px; margin: 0 auto; padding: 18px 16px 40px; }
.pg-intro { margin: 0 0 14px; color: var(--muted); }

/* light header with the clinic logo */
.pg-top.has-logo, .stf-top.has-logo { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.pg-home { display: flex; align-items: center; color: inherit; text-decoration: none; }
.pg-logo { height: 46px; width: auto; display: block; }
.stf-brand { display: flex; align-items: center; gap: 10px; }
.stf-top.has-logo .pg-logo { height: 38px; }
.has-logo .pg-back, .has-logo .stf-logout { color: var(--p); border-color: color-mix(in srgb, var(--p) 45%, #fff); }
.has-logo .stf-user { color: var(--muted); opacity: 1; font-weight: 600; }
.stf-nav-item:nth-child(2) .stf-ico { background: var(--p); }
