/* Patient registration (registerpatientdiversified) — UI only */

@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

body:has(.tl-reg-page) {
  background: #eef2f5;
}

.tl-reg-page {
  --tl-reg-ink: #1b2430;
  --tl-reg-muted: #5f6f7f;
  --tl-reg-line: #d5dde6;
  --tl-reg-surface: #ffffff;
  --tl-reg-primary: #0b2a4a;
  --tl-reg-accent: #0e7c7b;
  --tl-reg-danger: #c53030;
  --tl-reg-radius: 14px;
  --tl-reg-shadow: 0 10px 28px rgba(15, 35, 60, 0.08);
  font-family: "Figtree", "Segoe UI", sans-serif;
  color: var(--tl-reg-ink);
  /* Must override global theme `section { padding: 60px 0 }` (stylesmain/app.css) */
  padding: 28px 16px 48px !important;
  min-height: 0;
  height: auto;
  overflow: visible;
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(14, 124, 123, 0.12), transparent 55%),
    radial-gradient(900px 380px at 100% 0%, rgba(11, 42, 74, 0.1), transparent 50%),
    #eef2f5;
}

/* Nested cards are also <section> — neutralize the same global 60px vertical padding */
.tl-reg-page section.tl-reg-section,
section.tl-reg-page .tl-reg-section {
  padding: 0 !important;
  margin: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.tl-reg-page header,
.tl-reg-page + footer,
body:has(.tl-reg-page) header,
body:has(.tl-reg-page) footer {
  display: none !important;
}

/* Also hide site chrome when :has unsupported — page itself sets this via style push */
.tl-reg-hide-chrome header,
.tl-reg-hide-chrome footer {
  display: none !important;
}

.tl-reg-shell {
  max-width: 920px;
  margin: 0 auto;
}

.tl-reg-hero {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 22px 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--tl-reg-radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 252, 0.94) 100%);
  box-shadow: var(--tl-reg-shadow);
}

.tl-reg-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tl-reg-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.tl-reg-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tl-reg-brand-name {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--tl-reg-primary);
  letter-spacing: -0.02em;
}

.tl-reg-brand-tag {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tl-reg-accent);
}

.tl-reg-hero-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tl-reg-ink);
  letter-spacing: -0.02em;
}

.tl-reg-hero-copy {
  margin: 0;
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tl-reg-muted);
}

.tl-reg-location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8f5f4;
  border: 1px solid #c5e5e3;
  color: var(--tl-reg-primary);
  font-size: 13px;
  font-weight: 650;
}

.tl-reg-location i {
  color: var(--tl-reg-accent);
}

.tl-reg-alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #f0c2c2;
  background: #fdecec;
  color: #8a1f1f;
  font-size: 13px;
  font-weight: 600;
}

.tl-reg-alert.hideMe {
  display: none !important;
}

.tl-reg-form {
  position: relative;
  display: grid;
  gap: 10px;
}

.tl-reg-section {
  border: 1px solid var(--tl-reg-line);
  border-radius: var(--tl-reg-radius);
  background: var(--tl-reg-surface);
  box-shadow: var(--tl-reg-shadow);
  /* padding reset lives above — do not reintroduce vertical padding here */
  height: auto;
  min-height: 0;
}

.tl-reg-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid #eef2f6;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.tl-reg-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--tl-reg-ink);
  line-height: 1.25;
}

.tl-reg-section-head p {
  margin: 0;
  font-size: 12px;
  color: var(--tl-reg-muted);
  line-height: 1.35;
}

.tl-reg-section-body {
  padding: 12px 14px 14px;
  height: auto;
  min-height: 0;
}

/* Bootstrap .form-group margins only — keep section-body padding intact */
.tl-reg-page .tl-reg-section-body.form-group,
.tl-reg-page .tl-reg-section-body .form-group,
.tl-reg-page .tl-reg-choice-grid.form-group,
.tl-reg-page .tl-reg-choice-grid.question {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

.tl-reg-page .tl-reg-choice-grid.form-group,
.tl-reg-page .tl-reg-choice-grid.question {
  padding: 0;
}

.tl-reg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tl-reg-grid--address {
  grid-template-columns: 1.4fr 1fr 0.8fr 0.7fr;
}

.tl-reg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tl-reg-field--full {
  grid-column: 1 / -1;
}

.tl-reg-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tl-reg-muted);
}

.tl-reg-label .tl-reg-req {
  color: var(--tl-reg-danger);
  margin-left: 2px;
}

.tl-reg-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--tl-reg-muted);
}

.tl-reg-page .form-control,
.tl-reg-page select.form-control,
.tl-reg-page textarea.form-control {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c5d0db !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--tl-reg-ink);
  font-size: 14px;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tl-reg-page textarea.form-control {
  min-height: 88px;
  height: 88px;
  resize: vertical;
}

.tl-reg-page .form-control:focus,
.tl-reg-page select.form-control:focus,
.tl-reg-page textarea.form-control:focus {
  border-color: var(--tl-reg-accent) !important;
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.16) !important;
  outline: none;
}

.tl-reg-page .form-control:invalid:not(:placeholder-shown):not(:focus),
.tl-reg-page select.form-control:invalid:not(:focus) {
  border-color: #e2a0a0 !important;
}

.tl-reg-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  align-items: stretch;
  gap: 8px;
  min-height: 0;
  height: auto;
}

.tl-reg-page .checkbox-container {
  position: relative;
  margin: 0;
  min-height: 0;
  height: auto;
}

.tl-reg-page .checkbox-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tl-reg-page .checkbox-container label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--tl-reg-line);
  border-radius: 10px;
  background: #fbfcfd;
  color: var(--tl-reg-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tl-reg-page .checkbox-container label::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #9eb0c2;
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 0 0 0 var(--tl-reg-accent);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tl-reg-page .checkbox-container input[type="checkbox"]:checked + label {
  border-color: var(--tl-reg-accent);
  background: var(--tl-reg-accent);
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.16);
}

.tl-reg-page .checkbox-container input[type="checkbox"]:checked + label::before {
  border-color: #fff;
  background: #fff;
  box-shadow: inset 0 0 0 3px var(--tl-reg-accent);
}

.tl-reg-page .checkbox-container input[type="checkbox"]:focus-visible + label {
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.2);
}

.tl-reg-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 10px;
  border: 1px dashed #c5d0db;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--tl-reg-muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  min-height: 0;
  height: auto;
}

/* Single-option sections stay content-sized, not stretched across empty columns */
.tl-reg-choice-grid:has(> .checkbox-container:only-of-type),
.tl-reg-choice-grid:has(> .checkbox-container:only-child) {
  grid-template-columns: minmax(0, max-content);
  max-width: 100%;
}

.tl-reg-sig-controls {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.tl-reg-sig-controls .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.tl-reg-sig-controls .tl-reg-btn {
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 44px;
  height: auto;
  white-space: nowrap;
  padding-left: 18px;
  padding-right: 18px;
}

.tl-reg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.tl-reg-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.tl-reg-btn--primary {
  background: var(--tl-reg-primary) !important;
  border-color: var(--tl-reg-primary) !important;
  color: #fff !important;
}

.tl-reg-btn--primary:hover:not(:disabled),
.tl-reg-btn--primary:focus:not(:disabled) {
  background: #163a5c !important;
  border-color: #163a5c !important;
  color: #fff !important;
}

.tl-reg-btn--accent {
  background: var(--tl-reg-accent) !important;
  border-color: var(--tl-reg-accent) !important;
  color: #fff !important;
}

.tl-reg-btn--accent:hover:not(:disabled),
.tl-reg-btn--accent:focus:not(:disabled) {
  background: #0b6867 !important;
  border-color: #0b6867 !important;
  color: #fff !important;
}

.tl-reg-consent {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f8fb;
  border: 1px solid #dce6ef;
  color: #3d4d5c;
  font-size: 13px;
  line-height: 1.5;
}

.tl-reg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 0;
}

.tl-reg-actions .tl-reg-hint {
  flex: 1 1 220px;
}

.tl-reg-actions .tl-reg-btn {
  min-width: 160px;
}

.tl-reg-page .signature-images {
  margin-top: 14px;
  margin-bottom: 8px;
}

.tl-reg-page .signature-images + .card-body,
.tl-reg-page .consent-section {
  margin-top: 22px;
}

.tl-reg-sig-help {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tl-reg-muted);
}

.tl-reg-page #signature-container {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px !important;
  align-items: stretch;
}

.tl-reg-page #signature-container input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px;
  height: 1px;
}

.tl-reg-page #signature-container label {
  display: block;
  margin: 0;
  padding: 10px;
  border: 2px solid var(--tl-reg-line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tl-reg-page #signature-container label:hover {
  border-color: #9eb6d4;
}

.tl-reg-page #signature-container input[type="radio"]:checked + label,
.tl-reg-page #signature-container label:has(input:checked) {
  border-color: var(--tl-reg-accent);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.14);
}

.tl-reg-page #signature-container img {
  max-width: 260px !important;
  width: 100%;
  height: auto !important;
  display: block;
}

.tl-reg-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--tl-reg-radius);
  background: rgba(255, 255, 255, 0.84);
  color: var(--tl-reg-muted);
  font-size: 14px;
  font-weight: 700;
}

.tl-reg-loading.is-visible {
  display: flex;
}

.tl-reg-loading .fa {
  font-size: 26px;
  color: var(--tl-reg-primary);
}

.tl-reg-success {
  display: none;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #b7e0c7;
  background: #e8f6ee;
  color: #1f7a4d;
}

.tl-reg-success.is-visible {
  display: block;
}

.tl-reg-success strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.tl-reg-success span {
  font-size: 13px;
}

.tl-reg-error-inline {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tl-reg-danger);
}

.tl-reg-field.is-invalid .tl-reg-error-inline {
  display: block;
}

.tl-reg-field.is-invalid .form-control {
  border-color: #e2a0a0 !important;
}

@media (max-width: 900px) {
  .tl-reg-grid--address {
    grid-template-columns: 1fr 1fr;
  }

  .tl-reg-grid--address .tl-reg-field:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .tl-reg-page {
    padding: 16px 12px 36px;
  }

  .tl-reg-hero {
    padding: 16px;
  }

  .tl-reg-hero-title {
    font-size: 24px;
  }

  .tl-reg-brand-name {
    font-size: 20px;
  }

  .tl-reg-grid,
  .tl-reg-grid--address {
    grid-template-columns: 1fr;
  }

  .tl-reg-sig-controls {
    flex-direction: column;
  }

  .tl-reg-sig-controls .tl-reg-btn {
    width: 100%;
  }

  .tl-reg-section-head {
    padding: 10px 12px 8px;
  }

  .tl-reg-section-body {
    padding: 10px 12px 12px;
  }

  .tl-reg-actions .tl-reg-btn {
    width: 100%;
  }

  .tl-reg-choice-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tl-reg-choice-grid:has(> .checkbox-container:only-of-type),
  .tl-reg-choice-grid:has(> .checkbox-container:only-child) {
    grid-template-columns: 1fr;
  }
}
