/* The patient's account: the clinic's look (beige, Montserrat), made for a phone first. */
:root {
  --bg: #f7f5f1; --surface: #ffffff; --beige: #f1eadf; --sand: #e7dfd3; --ink: #111318; --muted: #7d7166; --line: #e7dfd3; --line-strong: #c9bba9;
  --accent: #6f5f51; --gold: #a98f77; --ok: #2f6b45; --ok-bg: #e6f0e6; --warn: #8a5a00; --warn-bg: #fbefd9; --err: #a23b2e; --err-bg: #f8e3df;
  --radius: 16px; --font: "Montserrat", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.boot { min-height: 100vh; }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* top */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: rgb(247 245 241 / .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top img { height: 30px; display: block; }
.top .sp { flex: 1; }
.langs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: #fff; }
.langs button { border: 0; background: none; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); }
.langs button.on { background: var(--ink); color: #fff; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }

/* layout */
.wrap { max-width: 860px; margin: 0 auto; padding: 18px 16px 110px; }
.hello { margin: 4px 0 16px; }
.hello h1 { font-size: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.empty { color: var(--muted); font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2a2c31; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* tabs: a bar at the bottom on a phone, pills on a wide screen */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 10px; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a.on { color: var(--ink); background: var(--beige); }
@media (min-width: 760px) {
  .tabs { position: static; justify-content: flex-start; gap: 6px; padding: 0; margin: 0 0 18px; background: none; border: 0; flex-wrap: wrap; }
  .tabs a { flex: none; flex-direction: row; gap: 7px; padding: 7px 14px; font-size: 13.5px; border: 1px solid var(--line); background: #fff; border-radius: 999px; }
  .tabs a svg { width: 17px; height: 17px; }
  .tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
  .wrap { padding-bottom: 40px; }
}

/* lists */
.rowl { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.rowl:first-of-type { border-top: 0; }
.rowl .grow { flex: 1; min-width: 0; }
.date-chip { flex: none; min-width: 58px; text-align: center; padding: 6px 4px; border-radius: 12px; background: var(--beige); line-height: 1.15; }
.date-chip b { display: block; font-size: 18px; } .date-chip span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--beige); color: var(--accent); white-space: nowrap; }
.badge.new { background: var(--warn-bg); color: var(--warn); } .badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.declined { background: var(--err-bg); color: var(--err); } .badge.cancelled { color: var(--muted); }
.answer { margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: var(--bg); font-size: 13.5px; }

/* medical record */
.visit { padding: 12px 0; border-top: 1px solid var(--line); }
.visit:first-of-type { border-top: 0; padding-top: 2px; }
.visit .vd { font-weight: 600; margin-bottom: 4px; }
.visit ul { margin: 0; padding: 0; list-style: none; }
.visit li { display: flex; gap: 8px; padding: 3px 0; }
.tooth { flex: none; min-width: 34px; padding: 0 6px; border-radius: 8px; background: var(--beige); color: var(--accent); font-size: 12px; font-weight: 700; text-align: center; line-height: 22px; height: 22px; }
.tooth.none { background: none; }

/* documents and images */
.doc { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.doc:first-of-type { border-top: 0; }
.doc .ic { flex: none; width: 40px; height: 48px; border-radius: 8px; background: var(--beige); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--accent); }
.doc .grow { flex: 1; min-width: 0; } .doc .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-img { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.grid-img a { display: block; border-radius: 12px; overflow: hidden; background: #111; aspect-ratio: 4 / 3; position: relative; }
.grid-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-img span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 11.5px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .65)); }

/* money */
.money-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.money-top b { font-size: 22px; }
.inv { padding: 12px 0; border-top: 1px solid var(--line); }
.inv:first-of-type { border-top: 0; }
.inv-h { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.inv table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13.5px; }
.inv td { padding: 3px 0; vertical-align: top; } .inv td.num { text-align: right; white-space: nowrap; padding-left: 10px; }

/* forms */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; font-size: 16px; }
.input:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
textarea.input { min-height: 84px; resize: vertical; }
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.parts label { display: block; cursor: pointer; }
.parts input { position: absolute; opacity: 0; pointer-events: none; }
.parts span { display: block; text-align: center; padding: 10px 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; font-weight: 600; font-size: 14px; }
.parts small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.parts input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); } .parts input:checked + span small { color: #ddd; }
.parts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; } .kv span { color: var(--muted); } .kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.err { color: var(--err); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); }
.note { padding: 10px 12px; border-radius: 12px; background: var(--beige); font-size: 13.5px; color: var(--accent); }
.pending { padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; margin-bottom: 12px; }

/* login / activation */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: 0 12px 40px rgb(60 45 30 / .08); }
.auth-card .logo { display: block; height: 40px; margin: 0 auto 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 20px; }
.auth-card h1 { font-size: 21px; margin-bottom: 6px; }
.auth-card .langs { display: flex; width: max-content; margin: 18px auto 0; }
.ok-big { text-align: center; padding: 12px 0; } .ok-big .tick { font-size: 40px; color: var(--ok); }

#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 50; pointer-events: none; max-width: 92vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--err); }
@media (min-width: 760px) { #toast { bottom: 28px; } }
