/**
 * modal-register.css
 * WeConnect Patient Registration Modal
 *
 * All classes are namespaced with "wc-reg-" / "wc-" to avoid conflicts
 * with the Drupal theme. CSS custom properties are scoped inside
 * .wc-reg-overlay so they don't bleed into the host page.
 */

/* ── Design tokens (scoped to the modal) ─────────────────────── */
.wc-reg-overlay {
  --wc-dark-maroon: #450a0a;
  --wc-azuki: #891515;
  --wc-red-mid: #bb2025;
  --wc-red-bright: #e1242a;
  --wc-salmon: #f58c84;
  --wc-blush: #fff5f4;
  --wc-grey-light: #ededf0;
  --wc-grey-bg: #fafafa;
  --wc-body-text: #5c5f66;
  --wc-dark: #343840;
  --wc-white: #ffffff;
  --wc-green: #3d6b22;
  --wc-green-bg: #f0fff4;
  --wc-green-border: #9ae6b4;
}

/* ── Trigger button (default block CTA) ──────────────────────── */
.wc-reg-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family:
    "Montserrat",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #bb2025;
  border: 2px solid #bb2025;
  border-radius: 6px;
  padding: 14px 28px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition:
    background 0.15s,
    border-color 0.15s;
  text-decoration: none;
}
.wc-reg-trigger:hover {
  background: #891515;
  border-color: #891515;
}
.wc-reg-trigger:focus-visible {
  outline: 2px solid #e1242a;
  outline-offset: 2px;
}

/* ── Overlay ─────────────────────────────────────────────────── */
.wc-reg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999; /* above Drupal toolbar (z-index 500) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}
.wc-reg-overlay.active {
  display: flex;
}

/* ── Modal container ─────────────────────────────────────────── */
.wc-reg-modal {
  background: var(--wc-white);
  border-radius: 12px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: wcRegSlideUp 0.25s ease-out;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  font-family:
    "Montserrat",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--wc-body-text);
  box-sizing: border-box;
}
@keyframes wcRegSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Header ──────────────────────────────────────────────────── */
.wc-reg-header {
  background: var(--wc-dark-maroon);
  padding: 28px 32px 24px;
  border-radius: 12px 12px 0 0;
  position: relative;
}
.wc-reg-logo {
  font-size: 13px;
  font-weight: 800;
  color: var(--wc-white);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.wc-reg-logo span {
  color: var(--wc-salmon);
}

.wc-reg-title {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 900;
  font-size: 22px;
  color: var(--wc-white);
  line-height: 1.2;
  margin-bottom: 6px;
}
.wc-reg-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
}
.wc-reg-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  line-height: 1;
}
.wc-reg-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--wc-white);
}

/* ── Progress bar ────────────────────────────────────────────── */
.wc-reg-progress {
  height: 3px;
  background: var(--wc-grey-light);
  overflow: hidden;
}
.wc-reg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wc-red-mid), var(--wc-salmon));
  width: 25%;
  transition: width 0.3s ease;
  border-radius: 0 2px 2px 0;
}

/* ── Step indicators ─────────────────────────────────────────── */
.wc-reg-steps {
  display: flex;
  align-items: stretch;
  padding: 0 32px;
  background: var(--wc-white);
  border-bottom: 1px solid var(--wc-grey-light);
}
.wc-reg-step-dot {
  flex: 1;
  text-align: center;
  padding: 14px 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wc-grey-light);
  position: relative;
  transition: color 0.2s;
}
.wc-reg-step-dot.active {
  color: var(--wc-red-mid);
}
.wc-reg-step-dot.done {
  color: var(--wc-green);
}

.wc-reg-step-dot::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: transparent;
  border-radius: 1px;
  transition: background 0.2s;
}
.wc-reg-step-dot.active::after {
  background: var(--wc-red-mid);
}
.wc-reg-step-dot.done::after {
  background: var(--wc-green);
}

.wc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 9px;
  font-weight: 800;
  margin-bottom: 3px;
}
.wc-reg-step-dot.done .wc-step-num {
  background: var(--wc-green);
  border-color: var(--wc-green);
  color: var(--wc-white);
}
.wc-step-label {
  display: block;
}

/* ── Form body ───────────────────────────────────────────────── */
.wc-reg-body {
  padding: 28px 32px 20px;
}

/* ── Step panels ─────────────────────────────────────────────── */
.wc-reg-panel {
  display: none;
}
.wc-reg-panel.active {
  display: block;
  animation: wcRegFadeIn 0.2s ease-out;
}
@keyframes wcRegFadeIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wc-step-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--wc-dark);
  margin-bottom: 4px;
}
.wc-step-desc {
  font-size: 12px;
  color: var(--wc-body-text);
  margin-bottom: 22px;
  line-height: 1.6;
}

/* ── Form field groups ───────────────────────────────────────── */
.wc-field-group {
  margin-bottom: 18px;
}

.wc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Labels ──────────────────────────────────────────────────── */
.wc-field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wc-dark);
  margin-bottom: 6px;
}
.wc-req {
  color: var(--wc-red-mid);
  margin-left: 2px;
}
.wc-opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 9px;
  color: var(--wc-body-text);
  margin-left: 4px;
}

/* ── Inputs & Selects ────────────────────────────────────────── */
.wc-field-input {
  width: 100%;
  box-sizing: border-box;
  font-family:
    "Montserrat",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--wc-dark);
  background: var(--wc-grey-bg);
  border: 1.5px solid var(--wc-grey-light);
  border-radius: 6px;
  padding: 11px 14px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.wc-field-input:focus {
  outline: none;
  border-color: var(--wc-red-mid);
  box-shadow: 0 0 0 3px rgba(187, 32, 37, 0.1);
}
.wc-field-input::placeholder {
  color: #a0a3ab;
  font-weight: 400;
}
.wc-field-input.invalid {
  border-color: var(--wc-red-bright);
  box-shadow: 0 0 0 3px rgba(225, 36, 42, 0.1);
}

/* Select arrow */
select.wc-field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235C5F66'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ── DOB row ─────────────────────────────────────────────────── */
.wc-dob-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Phone row ───────────────────────────────────────────────── */
.wc-phone-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
}
.wc-dial-code {
  font-size: 11px;
  padding: 11px 8px;
  padding-right: 24px;
  background-position: right 6px center;
}

/* ── Validation error messages ───────────────────────────────── */
.wc-field-error {
  display: none;
  font-size: 11px;
  color: var(--wc-red-bright);
  margin-top: 5px;
  font-weight: 600;
}
.wc-field-error.visible {
  display: block;
}

.wc-field-hint {
  font-size: 10px;
  color: var(--wc-body-text);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── Checkboxes ──────────────────────────────────────────────── */
.wc-field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.wc-field-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--wc-red-mid);
  cursor: pointer;
}
.wc-field-check-label {
  font-size: 12px;
  color: var(--wc-body-text);
  line-height: 1.6;
  cursor: pointer;
}
.wc-field-check-label strong {
  color: var(--wc-dark);
  font-weight: 700;
}
.wc-field-check-label a {
  color: var(--wc-red-mid);
}

/* ── Custom AOI multi-select widget ─────────────────────────── */
.wc-multi-select {
  position: relative;
}

.wc-multi-select-trigger {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  background: var(--wc-grey-bg);
  border: 1.5px solid var(--wc-grey-light);
  border-radius: 6px;
  padding: 8px 36px 8px 10px;
  cursor: pointer;
  position: relative;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  box-sizing: border-box;
}
.wc-multi-select-trigger:focus,
.wc-multi-select-trigger:focus-visible {
  outline: none;
  border-color: var(--wc-red-mid);
  box-shadow: 0 0 0 3px rgba(187, 32, 37, 0.1);
}
.wc-multi-select-trigger.invalid {
  border-color: var(--wc-red-bright);
  box-shadow: 0 0 0 3px rgba(225, 36, 42, 0.1);
}
.wc-multi-select-placeholder {
  font-size: 13px;
  color: #a0a3ab;
  font-weight: 400;
}
.wc-multi-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--wc-body-text);
  pointer-events: none;
}

/* Dropdown panel */
.wc-multi-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--wc-white);
  border: 1.5px solid var(--wc-grey-light);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}
.wc-multi-select-dropdown.open {
  display: block;
}

/* Search box inside dropdown */
.wc-aoi-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--wc-grey-light);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.wc-aoi-search {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--wc-grey-light);
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
}
.wc-aoi-search:focus {
  border-color: var(--wc-red-mid);
}

.wc-multi-select-category {
  padding: 8px 12px 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wc-body-text);
  background: var(--wc-grey-bg);
  border-bottom: 1px solid var(--wc-grey-light);
}
.wc-multi-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--wc-dark);
  cursor: pointer;
  transition: background 0.1s;
}
.wc-multi-select-option:hover {
  background: var(--wc-blush);
}
.wc-multi-select-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--wc-red-mid);
  cursor: pointer;
}

/* Selected pills */
.wc-aoi-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--wc-dark-maroon);
  color: var(--wc-white);
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 3px 8px 3px 10px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wc-pill-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.wc-pill-remove:hover {
  color: var(--wc-white);
}

/* ── Turnstile wrapper ───────────────────────────────────────── */
.wc-turnstile-wrap {
  margin-bottom: 14px;
}

/* ── Submit error ────────────────────────────────────────────── */
.wc-submit-error {
  font-size: 12px;
  font-weight: 600;
  color: var(--wc-red-bright);
  margin-top: 12px;
  min-height: 18px;
}

/* ── Footer navigation ───────────────────────────────────────── */
.wc-reg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px 24px;
  border-top: 1px solid var(--wc-grey-light);
}
.wc-btn-back {
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--wc-body-text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.15s;
}
.wc-btn-back:hover {
  color: var(--wc-dark);
}
.wc-btn-back.hidden {
  visibility: hidden;
  pointer-events: none;
}

.wc-btn-next,
.wc-btn-submit {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--wc-white);
  border: none;
  border-radius: 6px;
  padding: 12px 28px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.wc-btn-next {
  background: var(--wc-red-mid);
}
.wc-btn-next:hover {
  background: var(--wc-azuki);
}
.wc-btn-next:focus-visible {
  outline: 2px solid var(--wc-red-bright);
  outline-offset: 2px;
}

.wc-btn-submit {
  background: var(--wc-green);
}
.wc-btn-submit:hover {
  background: #2d5518;
}

.wc-btn-next:disabled,
.wc-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Success state ───────────────────────────────────────────── */
.wc-reg-success {
  display: none;
  text-align: center;
  padding: 48px 32px 40px;
}
.wc-reg-success.active {
  display: block;
}

.wc-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wc-green-bg);
  border: 2px solid var(--wc-green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 24px;
  color: var(--wc-green);
}
.wc-success-title {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 900;
  font-size: 22px;
  color: var(--wc-dark);
  margin-bottom: 10px;
}
.wc-success-body {
  font-size: 13px;
  color: var(--wc-body-text);
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto 24px;
}
.wc-success-close {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--wc-red-mid);
  background: none;
  border: 2px solid var(--wc-red-mid);
  border-radius: 6px;
  padding: 10px 24px;
  cursor: pointer;
  transition: background 0.15s;
}
.wc-success-close:hover {
  background: var(--wc-blush);
}

/* ── Responsive: mobile bottom-sheet ─────────────────────────── */
@media (max-width: 560px) {
  .wc-reg-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .wc-reg-modal {
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 95vh;
  }
  .wc-reg-header,
  .wc-reg-body,
  .wc-reg-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .wc-field-row {
    grid-template-columns: 1fr;
  }
  .wc-dob-row {
    grid-template-columns: 1fr 1fr;
  }
  .wc-reg-steps {
    padding: 0 16px;
  }
  .wc-phone-row {
    grid-template-columns: 90px 1fr;
  }
}

@media print {
  .wc-reg-overlay {
    display: none !important;
  }
}

.wc-field-check-label a {
  display: inline;
}
.wc-step-desc a {
  display: inline;
  color: #bb2025;
}
div#wc-sms-links a {
  display: inline;
  text-decoration: underline;
  font-size: 12px;
}
div#wc-sms-links .invalid {
  border: 2px solid red;
}
/* SMS consent section — greyed out when no phone number is entered */
#wc-sms-consent-wrapper.wc-sms-disabled {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}
/* iOS Safari auto-zooms any input with font-size < 16px on focus.
   This override prevents that without changing desktop appearance. */
@supports (-webkit-touch-callout: none) {
  .wc-reg-overlay input,
  .wc-reg-overlay select,
  .wc-reg-overlay textarea {
    font-size: 16px !important;
  }
}
