/* /clinic-register/ — facility registration wizard.
   Builds on /shared/tokens.css and /pages.css (header, footer, .btn, .pill, .field, .rules, .reveal,
   .form-error, .status-icon). Logical properties only, so one stylesheet serves RTL and LTR.
   No inline styles anywhere (strict CSP): the upload progress uses <progress>. */

.page-reg { background: var(--cloud); }
.reg-main { padding: 0 0 48px; }
.reg-wrap { width: 100%; max-width: calc(680px + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- intro ---------- */
.reg-intro { padding-top: 8px; }
.reg-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--slate); font-size: 13.5px; font-weight: 600; }
.reg-kicker .ic-slot { width: 18px; height: 18px; color: #0F766E; }
.reg-intro h1 { margin-top: 8px; font-size: clamp(25px, 6.4vw, 32px); font-weight: 900; line-height: 1.3; }
.reg-intro .lead { margin-top: 8px; color: var(--slate); font-size: 15.5px; line-height: 1.85; max-width: 36em; }
html[lang="en"] .reg-intro .lead { line-height: 1.6; }

/* ---------- progress ---------- */
.progress { margin-top: 22px; }
.progress-count { display: flex; flex-wrap: wrap; gap: 0 6px; color: var(--slate); font-size: 13.5px; font-weight: 600; }
.progress-count .sep, .progress-count #progress-step { color: var(--ink); }
.progress-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.progress-list li { min-width: 0; }
.progress-list .bar { display: block; height: 4px; border-radius: 2px; background: var(--line-2); transition: background-color var(--dur) var(--ease); }
.progress-list li.done .bar, .progress-list li.current .bar { background: var(--blue); }
.progress-list .lbl { display: none; margin-top: 7px; color: var(--slate); font-size: 12.5px; line-height: 1.4; }
.progress-list li.current .lbl { color: var(--ink); font-weight: 700; }
@media (min-width: 560px) {
  .progress-list .lbl { display: block; }
  .progress-count .sep, .progress-count #progress-step { display: none; }
}

.net-banner { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--amber-soft); color: var(--amber); font-size: 14px; line-height: 1.7; }
.net-banner .ic-slot { margin-top: 2px; }

/* ---------- card ---------- */
.reg-card {
  margin-top: 14px; padding: 22px 18px 24px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-1);
}
@media (min-width: 640px) { .reg-card { padding: 32px 32px 30px; } }
.reg-card[aria-busy="true"] { min-height: 220px; }

.step-head h2 { font-size: 21px; font-weight: 700; line-height: 1.4; }
.step-head h2:focus, .result h2:focus { outline: none; box-shadow: none; }
.step-head p { margin-top: 6px; color: var(--slate); font-size: 15px; line-height: 1.8; }
html[lang="en"] .step-head p { line-height: 1.6; }
.step-head p bdi, .result-text bdi { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.step-head + .notice, .step-head + #si-notice:not(:empty) { margin-top: 18px; }
.notice + .ready, .notice + .notice { margin-top: 12px; }

.who {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px;
  margin: -6px 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
  color: var(--slate); font-size: 13.5px; line-height: 1.6;
}
.who-text { min-width: 0; overflow-wrap: anywhere; }
.who-text bdi { color: var(--ink); font-weight: 600; }
.who .btn.link { min-height: 40px; font-size: 13.5px; }

/* ---------- form controls ---------- */
.form { margin-top: 22px; }
.row2 { display: grid; gap: 18px; }
@media (min-width: 600px) { .row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.field { min-width: 0; }
.field label .opt, .chips-field legend .opt { color: var(--mist); font-weight: 400; font-size: 13px; }
.hint { color: var(--slate); font-size: 13.5px; line-height: 1.7; }
.hint a, .notice a, .check a, .alt a { color: var(--ink); font-weight: 600; }

.ctl {
  display: block; width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--line-2);
  border-radius: var(--radius); background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.5;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ctl::placeholder { color: var(--mist); }
.ctl:hover { border-color: var(--mist); }
.ctl:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.ctl[aria-invalid="true"] { border-color: var(--red); }
.ctl[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(194, 65, 12, .16); }
.ctl:disabled { background: var(--cloud); color: var(--slate); cursor: default; }
.ctl.ltr { direction: ltr; text-align: left; }
[dir="rtl"] .ctl.ltr { text-align: right; }
[dir="rtl"] .ctl.ltr:placeholder-shown { direction: ltr; }
.ctl.pw { padding-inline-end: 52px; }
.ctl.code { font-size: 24px; font-weight: 700; letter-spacing: .32em; text-indent: .32em; text-align: center; font-variant-numeric: tabular-nums; }
[dir="rtl"] .ctl.code { text-align: center; }
textarea.ctl { min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.7; }
select.ctl {
  appearance: none; -webkit-appearance: none; padding-inline-end: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6478' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 9l-6 6-6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px 18px; background-position: right 14px center;
}
[dir="rtl"] select.ctl { background-position: left 14px center; }

/* fixed account type */
.type-tile {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1.5px solid var(--blue); border-radius: 14px; background: var(--blue-soft);
}
.type-tile .tile { background: var(--paper); color: var(--blue); }
.type-text { flex: 1; min-width: 0; display: grid; }
.type-k { color: var(--slate); font-size: 12.5px; font-weight: 600; }
.type-text strong { font-size: 16px; line-height: 1.5; }
.type-sub { color: var(--slate); font-size: 13.5px; line-height: 1.6; }
.type-check { color: var(--blue); }
.type-check .ic-slot { width: 22px; height: 22px; }
.type-other { margin-top: -8px; }

/* consent */
.check {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink-2); font-size: 14.5px; font-weight: 400 !important; line-height: 1.7; cursor: pointer;
}
.check:hover { border-color: var(--line-2); }
.check input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--blue); cursor: pointer; }
.check:has(input:focus-visible) { box-shadow: var(--focus); }
.check:has(input[aria-invalid="true"]) { border-color: var(--red); }

/* specialties */
.chips-field { margin: 0; padding: 0; border: 0; display: grid; gap: 9px; }
.chips-field legend { padding: 0; margin-bottom: 9px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); color: var(--ink-2);
  font-size: 14px; cursor: pointer; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--mist); }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip .chip-tick { display: none; width: 16px; height: 16px; }
.chip.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-d); font-weight: 600; }
.chip.on .chip-tick { display: inline-flex; }
.chip:has(input:focus-visible) { box-shadow: var(--focus); }

.forgot { margin-top: -2px; }
.forgot .btn.link { min-height: 40px; padding-inline: 2px; font-size: 13.5px; }

/* ---------- actions ---------- */
.step-actions { margin-top: 26px; display: grid; gap: 8px; }
.step-actions .btn { width: 100%; }
@media (min-width: 600px) {
  .step-actions { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px; }
  .step-actions .btn { width: auto; min-width: 200px; }
  .step-actions .btn.ghost { min-width: 0; }
}
.form .step-actions { margin-top: 8px; }
.btn.ghost { color: var(--slate); }
.btn.ghost:hover { background: var(--cloud); color: var(--ink); }
.btn.danger { background: var(--paper); }
.btn.danger:hover { background: var(--red-soft); }
.btn.is-busy::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent; animation: reg-spin .8s linear infinite;
}
.btn.is-busy .ic-slot { display: none; }
@keyframes reg-spin { to { transform: rotate(360deg); } }

.alt { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; color: var(--slate); font-size: 14.5px; line-height: 1.8; }
.alt .btn.link { min-height: 40px; padding-inline: 2px; color: var(--blue); font-weight: 700; text-decoration-color: rgba(29, 78, 216, .3); }
.alt .btn.link:hover { color: var(--blue-d); text-decoration-color: var(--blue); }

.resend { margin-top: 12px; display: grid; gap: 10px; }
.resend .hint { text-align: center; }

/* ---------- notices ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; border-radius: var(--radius); background: var(--cloud); color: var(--ink-2); font-size: 14.5px; line-height: 1.75; }
html[lang="en"] .notice { line-height: 1.6; }
.notice > .ic-slot { margin-top: 2px; color: var(--slate); }
.notice-body { flex: 1; min-width: 0; }
.notice-body strong { display: block; color: var(--ink); font-size: 15px; }
.notice-body p + p { margin-top: 4px; }
.notice.amber { background: var(--amber-soft); }
.notice.amber > .ic-slot, .notice.amber strong { color: var(--amber); }
.notice.blue { background: var(--blue-soft); }
.notice.blue > .ic-slot { color: var(--blue); }
.notice.red { background: var(--red-soft); color: var(--red); }
.notice.red > .ic-slot { color: var(--red); }
.notice-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.notice-actions .btn { background: var(--paper); }
#exists:empty { display: none; }
#exists:focus { outline: none; box-shadow: none; }
.missing-list { margin: 6px 0 0; padding-inline-start: 20px; }
.missing-list li { margin-top: 2px; }
.missing-list li::marker { color: var(--amber); }

.ready { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--green-soft); color: var(--ink-2); font-size: 14.5px; line-height: 1.75; }
.ready > .ic-slot { margin-top: 2px; width: 22px; height: 22px; color: var(--green-ink); }
.ready strong { display: block; color: var(--green-ink); font-size: 15.5px; }

/* ---------- documents ---------- */
.doc-hint { margin-top: 12px; }
.docs { margin-top: 16px; display: grid; gap: 12px; }
.doc { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.doc.missing { border-style: dashed; border-color: var(--line-2); background: #FBFCFE; }
.doc-top { display: flex; align-items: center; gap: 12px; }
.doc-top .tile { width: 40px; height: 40px; }
.doc.missing .doc-top .tile { background: var(--paper); border: 1px solid var(--line); }
.doc-hd { min-width: 0; }
.doc-hd h3 { font-size: 15.5px; font-weight: 700; line-height: 1.45; }
.doc-state { color: var(--slate); font-size: 13.5px; }
.doc-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-file { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--cloud); }
.doc-file-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 180px; }
.doc-file-main > .ic-slot { color: var(--slate); }
.doc-file-name { display: grid; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.5; }
.doc-file-name bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-file-size { color: var(--slate); font-size: 12.5px; font-weight: 400; justify-self: start; }
.doc-file-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.doc-file-side .btn { min-height: 40px; padding: 0 10px; font-size: 13.5px; }
.doc-file-side .btn .ic-slot { width: 17px; height: 17px; }
.doc-file-side[data-confirm] .doc-del { display: none; }
.doc-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.doc-confirm-q { flex: 1 1 100%; color: var(--ink-2); font-size: 13.5px; }
.doc-note { flex: 1 1 100%; color: var(--red); font-size: 13.5px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-actions .btn { min-height: 46px; }
.doc-progress { display: grid; gap: 6px; }
.doc-progress progress { width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; }
.doc-progress progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.doc-progress progress::-webkit-progress-value { background: var(--blue); border-radius: 3px; transition: width .2s linear; }
.doc-progress progress::-moz-progress-bar { background: var(--blue); border-radius: 3px; }
.doc-progress-text { color: var(--slate); font-size: 13px; }

/* ---------- review ---------- */
.summary { margin-top: 18px; display: grid; gap: 12px; }
.sum { border: 1px solid var(--line); border-radius: var(--radius-lg); }
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); }
[dir="rtl"] .sum-head { padding: 6px 16px 6px 8px; }
.sum-head h3 { font-size: 15.5px; font-weight: 700; }
.sum-head .btn.link { min-height: 40px; font-size: 13.5px; }
.sum dl { margin: 0; padding: 2px 16px 8px; }
.sum-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding: 9px 0; }
.sum-row + .sum-row { border-top: 1px solid var(--line); }
.sum-row dt { color: var(--slate); font-size: 13.5px; line-height: 1.6; }
.sum-row dd { margin: 0; min-width: 0; color: var(--ink); font-size: 14.5px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.sum-doc { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.sum-doc .pill { font-weight: 600; }
@media (max-width: 380px) { .sum-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---------- end states ---------- */
.result { display: grid; justify-items: start; }
.result h2 { margin-top: 16px; font-size: 22px; font-weight: 700; line-height: 1.4; }
.result-text { margin-top: 8px; color: var(--slate); font-size: 15.5px; line-height: 1.85; }
html[lang="en"] .result-text { line-height: 1.6; }
.result-text + .result-text { margin-top: 6px; }
.result-note { margin-top: 12px; width: 100%; padding: 12px 14px; border-radius: var(--radius); background: var(--cloud); color: var(--ink-2); font-size: 14.5px; }
.result .actions { width: 100%; }
.result .status-hint { width: 100%; }
.result-foot { margin-top: 14px; width: 100%; text-align: center; }
.facility-card {
  margin-top: 18px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.facility-card > div { flex: 1; min-width: 0; display: grid; }
.fc-k { color: var(--slate); font-size: 12.5px; }
.facility-card strong { font-size: 15.5px; overflow-wrap: anywhere; }
.facility-card .tile { width: 40px; height: 40px; }
@media (min-width: 600px) {
  .result .actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .result .actions .btn { width: auto; min-width: 220px; }
}

/* ---------- loading ---------- */
.reg-loading { display: grid; justify-items: center; gap: 12px; padding: 48px 0; color: var(--slate); font-size: 15px; text-align: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--blue); animation: reg-spin .9s linear infinite; }

