/* Ocean Dental Group referral form – scoped to .orf so it can't affect the rest of the site.
   Uses the site's own colour variables when present, otherwise the same values as fallbacks. */
.orf {
  --orf-ink: var(--ink, #14243a);
  --orf-navy: var(--navy, #0b2746);
  --orf-blue: var(--blue, #1f5fae);
  --orf-sky: var(--sky, #7fd0f2);
  --orf-muted: var(--muted, #5a6676);
  --orf-line: var(--line, #e7e0d4);
  --orf-sans: var(--sans, 'Manrope', system-ui, -apple-system, sans-serif);
  font-family: var(--orf-sans);
  color: var(--orf-ink);
  max-width: 860px;
  margin: 0 auto;
  text-align: left;
}
.orf *, .orf *::before, .orf *::after { box-sizing: border-box; }
.orf [hidden] { display: none !important; }

.orf-steps { display: none; list-style: none; margin: 0 0 22px; padding: 0; gap: 18px; justify-content: center; }
.orf--js .orf-steps { display: flex; }
.orf-steps__item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--orf-muted); }
.orf-steps__item span { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--orf-line); background: #fff; font-size: 12px; }
.orf-steps__item.is-active { color: var(--orf-navy); }
.orf-steps__item.is-active span { background: var(--orf-blue); border-color: var(--orf-blue); color: #fff; }
.orf-steps__item.is-done span { background: var(--orf-navy); border-color: var(--orf-navy); color: #fff; }

.orf-error { margin: 0 0 18px; padding: 12px 16px; border-radius: 8px; background: #fdecec; border: 1px solid #f3b6b6; color: #8a1f1f; font-size: 14px; line-height: 1.5; }
.orf-error a { color: inherit; font-weight: 700; }

.orf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.orf-row { display: grid; gap: 16px; margin-bottom: 16px; }
.orf-row--2 { grid-template-columns: 1fr 1fr; }
.orf-field { min-width: 0; }
.orf-field--gap { margin-top: 24px; }
.orf-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--orf-navy); }
.orf-req { color: #c0392b; }
.orf input[type=text], .orf input[type=email], .orf input[type=tel], .orf input[type=date], .orf select, .orf textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--orf-line); border-radius: 8px; background: #fff;
  font: inherit; font-size: 15px; color: var(--orf-ink);
}
.orf textarea { resize: vertical; min-height: 110px; }
.orf input:focus, .orf select:focus, .orf textarea:focus { outline: 2px solid var(--orf-blue); outline-offset: 1px; border-color: var(--orf-blue); }
.orf input:focus:not(:focus-visible), .orf select:focus:not(:focus-visible), .orf textarea:focus:not(:focus-visible) { outline-width: 0; }

.orf-label { margin: 28px 0 14px; padding-top: 18px; border-top: 1px solid var(--orf-line); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orf-navy); }
.orf-label:first-child { margin-top: 0; }
.orf-hint { font-weight: 400; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--orf-muted); }
.orf-intro { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--orf-muted); }

/* tooth chart */
.orf-chart { padding: 18px; border: 1px solid var(--orf-line); border-radius: 12px; background: #fff; text-align: center; }
.orf-chart__tag { margin: 4px 0; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orf-muted); }
.orf-chart__tag--sm { font-size: 10px; }
.orf-chart { --s: .95; padding: 22px 16px 18px; }
.orf-chart__row { display: flex; justify-content: center; gap: 2px; margin: 0; }
.orf-chart__row--upper { margin-top: 6px; }
.orf-chart__row--lower { margin-top: 3px; margin-bottom: 6px; }
.orf-chart__rule { border: 0; border-top: 1px dashed var(--orf-line); margin: 14px 0; }
/* Each tooth = picture + its number. Upper teeth: number on top, root up. Lower teeth: number underneath, root down. */
.orf-tooth { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 5px 3px; border: 1px solid transparent; border-radius: 10px; background: transparent; font: inherit; font-size: 12px; font-weight: 700; line-height: 1; color: var(--orf-muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.orf-tooth--up { flex-direction: column-reverse; }
/* fixed-height picture box: upper crowns sit at its bottom, lower crowns at its top, so rows meet cleanly in the middle */
.orf-tooth__pic { display: flex; justify-content: center; align-items: flex-start; height: calc(var(--ph) * var(--s) * 1px); }
.orf-tooth--up .orf-tooth__pic { align-items: flex-end; }
.orf-tooth img { display: block; max-width: none; width: calc(var(--w) * var(--s) * 1px); height: calc(var(--h) * var(--s) * 1px); pointer-events: none; user-select: none; transition: filter .15s, transform .15s; }
.orf-tooth:hover { border-color: var(--orf-blue); background: #f3f7fc; color: var(--orf-blue); }
.orf-tooth:hover img { transform: scale(1.05); }
.orf-tooth.is-on { background: rgba(31, 95, 174, .13); border-color: var(--orf-blue); color: var(--orf-blue); }
.orf-tooth.is-on img { filter: sepia(1) saturate(4.5) hue-rotate(172deg) brightness(.92) drop-shadow(0 1px 2px rgba(31, 95, 174, .35)); }
.orf-tooth:focus-visible { outline: 2px solid var(--orf-blue); outline-offset: 2px; }
.orf-chart__display { margin: 12px 0 0; font-size: 13px; color: var(--orf-muted); }

/* services + patient type */
.orf-services { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.orf-service { padding: 14px 16px; border: 1px solid var(--orf-line); border-radius: 10px; background: #fff; }
.orf-check { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 500; color: var(--orf-ink); cursor: pointer; }
.orf-check input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--orf-blue); }
.orf-sub { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--orf-line); gap: 10px; flex-direction: column; }
.orf-sub.open { display: flex; }
.orf-sub .orf-check { font-size: 14px; font-weight: 400; }
.orf-sub .orf-field label { font-size: 13px; }
.orf-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.orf-type { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--orf-line); border-radius: 10px; background: #fff; font-size: 14px; font-weight: 500; cursor: pointer; }
.orf-type input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--orf-blue); }
.orf-type:has(input:checked) { border-color: var(--orf-blue); background: #eef4fc; }

/* buttons */
.orf-actions { margin-top: 28px; }
.orf-actions--split { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.orf-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 200px; padding: 14px 30px; border: 0; border-radius: 999px; background: var(--orf-blue); color: #fff; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .04em; text-decoration: none; cursor: pointer; transition: background .2s; }
.orf-btn:hover { background: var(--orf-navy); }
.orf-btn:disabled { opacity: .65; cursor: progress; }
.orf-back { padding: 12px 6px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--orf-muted); cursor: pointer; }
.orf-back:hover { color: var(--orf-navy); }
.orf-link { font-weight: 700; color: var(--orf-blue); text-decoration: none; }

/* upload */
.orf-drop { position: relative; padding: 34px 20px; border: 2px dashed #c9d3df; border-radius: 12px; background: #fff; text-align: center; color: var(--orf-muted); cursor: pointer; transition: border-color .2s, background .2s; }
.orf-drop:hover, .orf-drop.is-over, .orf-drop:focus-visible { border-color: var(--orf-blue); background: #eef4fc; outline: none; }
.orf-drop svg { color: var(--orf-blue); }
.orf-drop__title { margin: 8px 0 2px; font-size: 16px; font-weight: 600; color: var(--orf-navy); }
.orf-drop__title span { color: var(--orf-blue); text-decoration: underline; }
.orf-drop__hint { margin: 0; font-size: 13px; }
.orf-drop__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.orf-files { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.orf-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--orf-line); border-radius: 10px; background: #fff; }
.orf-file__thumb { width: 52px; height: 52px; flex: none; border-radius: 8px; overflow: hidden; background: #eef2f7; display: flex; align-items: center; justify-content: center; }
.orf-file__thumb img { width: 100%; height: 100%; object-fit: cover; }
.orf-file__thumb b { font-size: 11px; color: var(--orf-muted); }
.orf-file__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.orf-file__name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orf-file__meta { font-size: 12px; color: var(--orf-muted); }
.orf-file__bar { display: block; height: 4px; border-radius: 2px; background: #e5eaf0; overflow: hidden; }
.orf-file__bar span { display: block; height: 100%; width: 0; background: var(--orf-blue); transition: width .2s; }
.orf-file--done .orf-file__bar span { background: #2e9e63; }
.orf-file--error .orf-file__meta { color: #b3261e; }
.orf-file--error .orf-file__bar span { background: #b3261e; }
.orf-file button { border: 0; background: none; font: inherit; cursor: pointer; }
.orf-file__retry { font-size: 13px; font-weight: 700; color: var(--orf-blue); }
.orf-file__remove { width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--orf-muted); }
.orf-file__remove:hover { background: #eef2f7; color: var(--orf-ink); }

/* thank you */
.orf-thanks { padding: 36px 20px; text-align: center; border: 1px solid var(--orf-line); border-radius: 14px; background: #fff; }
.orf-thanks:focus { outline: none; }
.orf-thanks__icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: #e6f4ec; color: #2e9e63; }
.orf-thanks h3 { margin: 16px 0 6px; font-size: 28px; color: var(--orf-navy); }
.orf-thanks__lead { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.orf-thanks p { margin: 0 auto 10px; max-width: 520px; color: var(--orf-muted); line-height: 1.6; }
.orf-thanks__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px; margin-top: 18px; }

@media (max-width: 640px) {
  .orf-row--2, .orf-services { grid-template-columns: 1fr; }
  .orf-types { grid-template-columns: 1fr 1fr; }
  .orf-btn { width: 100%; }
  .orf-actions--split { flex-direction: column-reverse; }
  .orf-chart { --s: .7; padding: 14px 6px; }
  .orf-chart__row--perm { display: grid; grid-template-columns: repeat(8, 1fr); justify-items: center; row-gap: 6px; }
  .orf-tooth { padding: 4px 2px; gap: 5px; font-size: 11px; }
}
/* tablet widths: scale the teeth down so each row of 16 still fits the card */
@media (min-width: 641px) and (max-width: 760px) { .orf-chart { --s: .64; } }
@media (min-width: 761px) and (max-width: 899px) { .orf-chart { --s: .78; } }
@media (max-width: 400px) { .orf-types { grid-template-columns: 1fr; } }
