/* World Dentistry form system. Fonts are self-hosted: no third-party requests from patient pages. */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500 600; font-display: swap; src: url(fonts/cormorant-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500 600; font-display: swap; src: url(fonts/cormorant-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Outfit"; font-weight: 400 600; font-display: swap; src: url(fonts/outfit-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-weight: 400 600; font-display: swap; src: url(fonts/outfit-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --ivory: #FAF7F2;
  --white: #FDFAF6;
  --cream: #F2EBE0;
  --beige: #E4D8C8;
  --taupe: #A89880;
  --gold: #C8A45A;
  --gold-deep: #9C7A36;
  --gold-pale: #F0E4C4;
  --charcoal: #1A1714;
  --charcoal-mid: #2C2622;
  --muted: #6E6257;
  --yes: #A3342B;
  --no: #2F6B4F;
  --accent: var(--gold-deep);
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ivory); color: var(--charcoal); font: 400 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 620px; margin: 0 auto; padding: 18px 16px 56px; }
.wrap.wide { max-width: 1160px; }
h1, h2, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: 0.01em; }
h1 { font-size: 2rem; line-height: 1.1; margin: 0 0 6px; }
h2 { font-size: 1.45rem; line-height: 1.2; margin: 28px 0 10px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.small { font-size: 0.88rem; color: var(--muted); }
[hidden] { display: none !important; }
a { color: var(--accent); }

/* Header */
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lang { display: inline-flex; border: 1px solid var(--beige); border-radius: 99px; padding: 3px; background: var(--white); }
.lang button { font: 600 0.8rem var(--sans); letter-spacing: 0.06em; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 99px; cursor: pointer; min-height: 32px; }
.lang button[aria-pressed=true] { background: var(--charcoal); color: var(--ivory); }
.brand-logo { display: block; height: 92px; width: auto; max-width: 70%; margin: 4px auto 14px; object-fit: contain; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 18px 0; border: 0; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--beige); border-radius: var(--radius); padding: 22px 18px; box-shadow: 0 1px 0 rgba(26, 23, 20, 0.03), 0 12px 32px -24px rgba(26, 23, 20, 0.25); }

/* Chooser */
.choices { display: grid; gap: 14px; }
.choice-card { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 16px; text-decoration: none; color: inherit; background: var(--white);
  border: 1px solid var(--beige); border-radius: var(--radius); padding: 16px; transition: border-color .15s, transform .15s; }
.choice-card:hover, .choice-card:focus-visible { border-color: var(--gold); transform: translateY(-1px); }
.choice-card img { width: 96px; height: 72px; object-fit: contain; }
.choice-card .t { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1.15; }
.choice-card .d { color: var(--muted); font-size: 0.9rem; }
.choice-card .arrow { color: var(--gold-deep); font-size: 1.4rem; }

/* Fields */
.field { padding: 14px 0; border-bottom: 1px solid var(--cream); }
.field:last-of-type { border-bottom: 0; }
.field > label, .legend { display: block; font-weight: 500; margin-bottom: 8px; }
.req { color: var(--gold-deep); }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[inputmode=numeric], textarea, select {
  width: 100%; font: 400 17px var(--sans); color: var(--charcoal); background: var(--ivory);
  border: 1.5px solid var(--beige); border-radius: 10px; padding: 12px 14px; min-height: 50px; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, .seg input:focus-visible + span, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.section-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin: 22px 0 2px; padding-top: 6px; border-top: 1px solid var(--beige); }
.info { color: var(--charcoal-mid); background: var(--cream); border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-size: 0.95rem; }

/* Yes/No + option segments */
.yn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; }
.yn .legend { margin: 0; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--beige);
  border-radius: 10px; background: var(--ivory); font-weight: 500; }
.seg input:checked + span { background: var(--charcoal); border-color: var(--charcoal); color: var(--ivory); }
.seg input[value=Da]:checked + span { background: var(--yes); border-color: var(--yes); }
.seg.wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); width: 100%; }
@media (max-width: 420px) { .yn { grid-template-columns: minmax(0, 1fr); } }

/* Signature */
.sig-wrap { position: relative; border: 1.5px dashed var(--taupe); border-radius: 10px; background: #fff; touch-action: none; }
.sig-wrap canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; inset: auto 0 10px 0; text-align: center; color: var(--taupe); font-size: 0.85rem; pointer-events: none; }
.sig-line { position: absolute; left: 7%; right: 7%; bottom: 36px; border-bottom: 1px solid var(--beige); pointer-events: none; }
.linkbtn { background: none; border: 0; color: var(--gold-deep); font: 500 0.9rem var(--sans); padding: 8px 0; min-height: 0; cursor: pointer; text-decoration: underline; }

.err { color: var(--yes); font-size: 0.88rem; margin: 6px 0 0; }
.field.has-err input, .field.has-err .sig-wrap, .field.has-err .seg span { border-color: var(--yes); }

button.primary, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem var(--sans); letter-spacing: 0.02em;
  border: 0; border-radius: 12px; padding: 14px 22px; min-height: 54px; cursor: pointer; background: var(--charcoal); color: var(--ivory); text-decoration: none; }
button.primary:hover, .btn:hover { background: var(--charcoal-mid); }
button.secondary, .btn.secondary { background: transparent; color: var(--charcoal); border: 1.5px solid var(--beige); font-weight: 500; min-height: 44px; padding: 10px 16px; }
button[disabled] { opacity: 0.6; cursor: wait; }
.block { width: 100%; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { font-size: 0.82rem; color: var(--muted); margin: 16px 0 12px; }

.done { text-align: center; padding: 34px 18px; }
.done .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--gold-pale); color: var(--gold-deep); display: grid; place-items: center; margin: 0 auto 12px; font-size: 1.6rem; }
.ref { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 2.3rem; letter-spacing: 0.22em; font-weight: 700; margin: 12px 0; color: var(--charcoal); }
.foot { text-align: center; color: var(--taupe); font-size: 0.78rem; margin-top: 28px; letter-spacing: 0.04em; }

/* Staff inbox */
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { min-height: 38px; padding: 6px 14px; background: transparent; color: var(--charcoal); border: 1.5px solid var(--beige); border-radius: 99px; font: 500 0.9rem var(--sans); cursor: pointer; }
.tabs button[aria-pressed=true] { background: var(--charcoal); color: var(--ivory); border-color: var(--charcoal); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 920px) { .grid { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); align-items: start; } .detail { position: sticky; top: 16px; } }
.list { list-style: none; margin: 0; padding: 0; }
.list li button { width: 100%; text-align: left; background: var(--white); color: var(--charcoal); border: 1px solid var(--beige); border-radius: 12px; margin-bottom: 8px;
  padding: 12px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; font: 400 1rem var(--sans); cursor: pointer; }
.list li button[aria-current=true] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.list .r { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: 0.08em; }
.list .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .t { color: var(--muted); font-size: 0.82rem; grid-column: 1 / -1; }
.pill { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--beige); color: var(--muted); white-space: nowrap; }
.pill.new { background: var(--gold); color: var(--charcoal); border-color: var(--gold); }
.detail dl { margin: 0; }
.detail dt { font-weight: 500; color: var(--muted); font-size: 0.88rem; margin-top: 12px; }
.detail dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail dd.da { color: var(--yes); font-weight: 600; }
.detail dd.nu { color: var(--no); }
.detail dd img { max-width: 260px; width: 100%; border: 1px solid var(--beige); border-radius: 8px; background: #fff; }
.detail .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.detail .sec { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin-top: 18px; color: var(--charcoal); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.login { max-width: 400px; margin: 8vh auto 0; text-align: center; }
.login form { text-align: left; }
