:root{
  --ml-green:#11C491;      /* MagicLogin primary */
  --ml-green-d:#03A678;
  --ml-gray-50:#F3F4F6;
  --ml-gray-200:#E5E7EB;
  --ml-gray-700:#3F4041;
  --ml-red:#f74d45;
}

/* Alerts (match MagicLogin) */
.ml-alert{padding:14px 16px;border-radius:10px;margin:10px 0 18px;
  font-size:14px;border:1px solid transparent;background:#FDECEC;color:#7A1E1B}
.ml-alert--error{border-color:var(--ml-red)}
.ml-alert--success{background:#ECFDF5;border-color:#A7F3D0;color:#065F46}

/* Buttons (match MagicLogin) */
.ml-btn{display:inline-block;border-radius:10px;padding:12px 20px;
  font-weight:700;border:1px solid transparent;text-align:center;
  box-shadow:0 2px 0 rgba(0,0,0,.06)}
.ml-btn--primary{background:var(--ml-green);border-color:var(--ml-green);color:#fff}
.ml-btn--primary:hover{background:var(--ml-green-d);border-color:var(--ml-green-d)}
.ml-btn--muted{background:var(--ml-gray-50);border-color:var(--ml-gray-200);color:var(--ml-gray-700)}
.ml-btn--muted:hover{filter:brightness(.97)}

/* Button group spacing like MagicLogin */
.ml-btn-group{display:inline-flex;gap:12px;align-items:center}

/* Inline field error triangle (used under email) */
.ml-inline-error{position:relative;margin:8px 0 16px;background:#FDECEC;color:#7A1E1B;
  border:1px solid var(--ml-red);border-radius:10px;padding:12px 14px}
.ml-inline-error::before{content:"";position:absolute;left:16px;top:-8px;border:8px solid transparent;
  border-bottom-color:#FDECEC}

/* Normalize ML buttons so both are identical height */
.ml-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 22px;
  line-height:1;
  min-height:48px;
  box-sizing:border-box;
}
button.ml-btn{
  -webkit-appearance:none;
  appearance:none;
  border:1px solid transparent;
}
.ml-btn-group .ml-btn{height:48px}

/* Loading state */
.ml-btn.is-loading{opacity:.85;pointer-events:none;position:relative}
.ml-btn.is-loading::after{
  content:"";width:16px;height:16px;border-radius:50%;
  border:2px solid rgba(255,255,255,.6);border-top-color:#fff;
  animation:phspin .8s linear infinite;position:absolute;right:14px;top:50%;transform:translateY(-50%)
}
@keyframes phspin{to{transform:translateY(-50%) rotate(360deg)}}

/* Scope to UM register wrapper to win specificity */
.um.um-register .ml-alert{padding:14px 16px;border-radius:10px;margin:10px 0 18px;font-size:14px;border:1px solid transparent;background:#FDECEC;color:#7A1E1B}
.um.um-register .ml-alert--success{background:#ECFDF5;border-color:#A7F3D0;color:#065F46}
.um.um-register .ml-alert--error{border-color:#f74d45}

.um.um-register .ml-inline-error{position:relative;margin:8px 0 16px;background:#FDECEC;color:#7A1E1B;border:1px solid #f74d45;border-radius:10px;padding:12px 14px}
.um.um-register .ml-inline-error::before{content:"";position:absolute;left:16px;top:-8px;border:8px solid transparent;border-bottom-color:#FDECEC}

.um.um-register .ml-btn{display:inline-flex;align-items:center;justify-content:center;border-radius:10px;padding:12px 22px;font-weight:700;border:1px solid transparent;box-shadow:0 2px 0 rgba(0,0,0,.06);line-height:1;min-height:48px;box-sizing:border-box}
.um.um-register .ml-btn--primary{background:#11C491;border-color:#11C491;color:#fff}
.um.um-register .ml-btn--primary:hover{background:#03A678;border-color:#03A678}
.um.um-register .ml-btn--muted{background:#F3F4F6;border-color:#E5E7EB;color:#3F4041}
.um.um-register .ml-btn--muted:hover{filter:brightness(.97)}
.um.um-register .ml-btn-group{display:inline-flex;gap:12px;align-items:center}
.um.um-register .ml-btn-group .ml-btn{height:48px}
.um.um-register .ml-btn.is-loading{opacity:.85;pointer-events:none;position:relative;padding-right:42px}
.um.um-register .ml-btn.is-loading::after{content:"";width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,255,255,.6);border-top-color:#fff;animation:phspin .8s linear infinite;position:absolute;right:14px;top:50%;transform:translateY(-50%)}
@keyframes phspin{to{transform:translateY(-50%) rotate(360deg)}}

/* Ensure select2 and checkboxes keep UM look even if order changed */
.um.um-register .select2-container .select2-selection--multiple{min-height:40px;border-radius:4px}
.um.um-register .um-field-checkbox .um-field-checkbox-state i[class*="checkbox"]{font-style:normal}

/* ==== Provider Hub – Settings (registration style + Compliance polish) ==== */

/* WIDER CONTAINER (controls left/right white space) */
.ph-settings{max-width:980px;margin:0 auto;padding:12px 16px}

/* UM wrapper cleanup */
.ph-settings .um-form{background:transparent;padding:0;border:0;box-shadow:none}

/* SECTION DIVIDERS (dashed lines exactly like Compliance) */
.ph-settings .ph-section{position:relative;padding:22px 0}
.ph-settings .ph-section + .ph-section::before{
  content:"";position:absolute;left:0;right:0;top:0;border-top:4px dashed #e9ecef
}

/* Extra breathing room above the action buttons */
.ph-settings .ph-actions{padding-top:28px}

/* LABELS */
.ph-settings .um-field-label label{font-weight:700;font-size:20px;line-height:1.25;color:#1f2937}

/* HELP TEXT */
.ph-settings .um-field .um-field-area>small,
.ph-settings .ph-help{display:block;color:#6b7280;margin-top:6px}

/* INPUTS */
.ph-settings input.um-form-field[type=email],
.ph-settings select.um-form-field{width:100%;padding:14px 16px;border:1px solid #d1d5db;border-radius:10px;background:#fff;font-size:14px}

/* PROGRAMS GRID */
.ph-settings .um-field-programs .um-field-area{display:grid;grid-template-columns:repeat(2,minmax(280px,1fr));gap:12px 42px}
.ph-settings .um-field-checkbox{display:flex;align-items:center;gap:28px !important}
.ph-settings .um-field-checkbox-state{width:24px;display:inline-flex;justify-content:center}
.ph-settings .um-field-checkbox-state i{font-size:22px;color:#9ca3af}
.ph-settings .um-field-checkbox.active .um-field-checkbox-state i{color:#10b981}
.ph-settings .um-field-checkbox .um-field-checkbox-option{font-weight:600;color:#374151;} 

/* BUTTON GROUP (Save + Logout) */
.ph-settings .ml-btn-group{display:flex;justify-content:flex-end;gap:14px;flex-wrap:wrap;margin-top:18px}
.ph-settings .ml-btn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center;line-height:1;min-height:48px;box-sizing:border-box;border-radius:12px;padding:12px 20px;font-weight:700}
.ph-settings .ml-btn--primary{background:var(--ml-green);border:1px solid var(--ml-green);color:#fff}
.ph-settings .ml-btn--primary:hover{background:var(--ml-green-d);border-color:var(--ml-green-d)}
.ph-settings .ml-btn--muted{background:var(--ml-gray-50);border:1px solid var(--ml-gray-200);color:var(--ml-gray-700)}
.ph-settings .ml-btn--muted:hover{filter:brightness(.97)}

/* MOBILE */
@media (max-width:860px){
  .ph-settings .um-field-programs .um-field-area{grid-template-columns:1fr;gap:10px 16px}
  .ph-settings{max-width:100%;padding:12px 12px}
  .ph-settings .ml-btn-group{justify-content:flex-start}
}

/* ==== Provider Hub – Settings (registration style + Compliance polish) ==== */

/* WIDER CONTAINER */
.ph-settings{max-width:980px;margin:0 auto;padding:12px 16px}

/* UM wrapper cleanup */
.ph-settings .um-form{background:transparent;padding:0;border:0;box-shadow:none}

/* SECTION DIVIDERS (dashed) */
.ph-settings .ph-section{position:relative;padding:22px 0}
.ph-settings .ph-section + .ph-section::before{
  content:"";position:absolute;left:0;right:0;top:0;border-top:4px dashed #e9ecef
}
/* extra space before the action buttons row */
.ph-settings .ph-actions{padding-top:28px}

/* LABELS & HELP */
.ph-settings .um-field-label label{font-weight:700;font-size:20px;line-height:1.25;color:#1f2937}
.ph-settings .um-field .um-field-area>small,
.ph-settings .ph-help{display:block;color:#6b7280;margin-top:6px}

/* INPUTS */
.ph-settings input.um-form-field[type=email],
.ph-settings select.um-form-field{width:100%;padding:14px 16px;border:1px solid #d1d5db;border-radius:10px;background:#fff;font-size:14px}

/* PROGRAMS GRID */
.ph-settings .um-field-programs .um-field-area{display:grid;grid-template-columns:repeat(2,minmax(280px,1fr));gap:12px 42px}
.ph-settings .um-field-checkbox-state{width:24px;display:inline-flex;justify-content:center}
.ph-settings .um-field-checkbox-state i{font-size:22px;color:#9ca3af}
.ph-settings .um-field-checkbox.active .um-field-checkbox-state i{color:#10b981}
.ph-settings .um-field-checkbox .um-field-checkbox-option{font-weight:600;color:#374151}

/* BUTTON GROUP (Save + Logout) */
.ph-settings .ml-btn-group{display:flex;justify-content:flex-end;gap:14px;flex-wrap:wrap;margin-top:18px}
.ph-settings .ml-btn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center;line-height:1;min-height:48px;box-sizing:border-box;border-radius:12px;padding:12px 20px;font-weight:700}
.ph-settings .ml-btn--primary{background:var(--ml-green);border:1px solid var(--ml-green);color:#fff}
.ph-settings .ml-btn--primary:hover{background:var(--ml-green-d);border-color:var(--ml-green-d)}
.ph-settings .ml-btn--muted{background:var(--ml-gray-50);border:1px solid var(--ml-gray-200);color:var(--ml-gray-700)}
.ph-settings .ml-btn--muted:hover{filter:brightness(.97)}

/* MOBILE */
@media (max-width:860px){
  .ph-settings .um-field-programs .um-field-area{grid-template-columns:1fr;gap:10px 16px}
  .ph-settings{max-width:100%;padding:12px 12px}
  .ph-settings .ml-btn-group{justify-content:flex-start}
}

/* ===== Select2 (multiple) — centered chips, no pill scrollbars ===== */
.ph-settings .select2-container--default .select2-selection--multiple{
  box-sizing:border-box;
  min-height:48px;            /* match other inputs */
  height:auto;                /* grow when chips wrap */
  padding:8px 10px;
  display:flex;               /* vertical centering */
  align-items:center;
  flex-wrap:wrap;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
}

.ph-settings .select2-container--default
.select2-selection--multiple .select2-selection__rendered{
  display:flex;
  flex-wrap:wrap;
  align-items:center;         /* center the chips */
  gap:8px;
  margin-top:4px;
  padding:0;                  /* remove default top padding */
  width:100%;
}

.ph-settings .select2-container--default
.select2-selection--multiple .select2-selection__choice{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin:0;                   /* no top/bottom margins -> true centering */
  padding:4px 8px;
  border-radius:8px;
  background:#ECFDF5;
  border:1px solid #A7F3D0;
  color:#065F46;
  white-space:nowrap;
  line-height:1;
  overflow:visible;           /* kill tiny scrollbars */
  scrollbar-width:none;       /* Firefox */
}

/* --- Final vertical-centering nudge for Select2 pills --- */
.ph-settings .select2-container--default .select2-selection--multiple{
  padding:10px 12px;                 /* a bit more top/bottom padding */
}

.ph-settings .select2-container--default
.select2-selection--multiple .select2-selection__rendered{
  align-items:center;                 /* keep UL centered */
  gap:8px;
}

.ph-settings .select2-container--default
.select2-selection--multiple .select2-selection__choice{
  align-self:center;                  /* center each chip in the row */
}

.ph-settings .select2-container--default
.select2-selection--multiple .select2-search--inline{
  align-self:center;                  /* center the inline search input too */
}

.ph-settings .um-field-checkbox .um-field-checkbox-option {margin:0; gap:0;}

/* ==== Admin Filters (Contacts/Notifications) ==== */
.ph-filters .ph-filter-panel{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  margin-bottom:16px;
}
.ph-filters .phf-group{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.ph-filters .phf-group label{font-weight:600;}
.ph-filters .phf-group input,
.ph-filters .phf-group select{
  width:220px;
  max-width:100%;
}

