/*
  ISP Forge Stage 105.2L CLEAN
  Global Popup / Form Readability Contrast

  Purpose:
  - Improve washed-out labels, helper text, inputs, selects and textareas inside existing popups/modals.
  - Keep existing popup logic, save/cancel behaviour, tabs, field names and routes untouched.
  - Avoid page-level layout changes. This is a readability/contrast layer only.
*/

:root{
  --ispforge-modal-ink:#0f172a;
  --ispforge-modal-muted:#475569;
  --ispforge-modal-label:#243044;
  --ispforge-modal-field-bg:#ffffff;
  --ispforge-modal-field-border:#cbd5e1;
  --ispforge-modal-field-focus:#2563eb;
  --ispforge-modal-field-disabled-bg:#eef2f7;
  --ispforge-modal-field-disabled-ink:#334155;
  --ispforge-modal-placeholder:#64748b;
}

/* Known Customer / Data Account / Customer 360 modal families. */
[data-stage822-modal],
[data-stage823-modal],
[data-stage824-modal],
[data-stage825-modal],
[data-stage828-modal],
[data-stage829-modal],
[data-stage8210-modal],
[data-stage8211-modal],
[data-stage8212-modal]{
  color:var(--ispforge-modal-ink) !important;
}

/* Modal surface text. */
:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is(h1,h2,h3,h4,p,span,div,td,th,li){
  color:inherit;
}

/* Field labels: the main problem shown in screenshots. */
:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is(
  label,
  .stage823-field > label,
  .stage824-field > label,
  .stage825-field > label,
  .stage828-field > label,
  .stage829-field > label,
  .stage8210-field > label,
  .stage8211-field > label,
  .stage8212-field > label
){
  color:var(--ispforge-modal-label) !important;
  opacity:1 !important;
  text-shadow:none !important;
  font-weight:700 !important;
}

/* Helper text / notes must be readable but not louder than labels. */
:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is(small,.stage823-field small,.stage824-field small,.stage825-field small,.stage828-field small,.stage829-field small,.stage8210-field small,.stage8211-field small,.stage8212-field small,.stage824-muted,.stage823-muted,.muted,.help-text){
  color:var(--ispforge-modal-muted) !important;
  opacity:1 !important;
}

/* Form fields in modals: professional contrast, no washed-out grey-on-grey. */
:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is(input,select,textarea){
  background:var(--ispforge-modal-field-bg) !important;
  color:var(--ispforge-modal-ink) !important;
  border-color:var(--ispforge-modal-field-border) !important;
  opacity:1 !important;
  box-shadow:none !important;
}

:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is(input,select,textarea)::placeholder{
  color:var(--ispforge-modal-placeholder) !important;
  opacity:1 !important;
}

:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is(input,select,textarea):focus{
  border-color:var(--ispforge-modal-field-focus) !important;
  box-shadow:0 0 0 3px rgba(37,99,235,.14) !important;
  outline:none !important;
}

/* Disabled/read-only fields still need readable values. */
:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is(input,select,textarea):is(:disabled,[readonly]){
  background:var(--ispforge-modal-field-disabled-bg) !important;
  color:var(--ispforge-modal-field-disabled-ink) !important;
  -webkit-text-fill-color:var(--ispforge-modal-field-disabled-ink) !important;
  opacity:1 !important;
}

/* Select widgets and generated/multi-select blocks often inherit the same washed-out colour. */
:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is(.select2-selection,.choices,.choices__inner,.multiselect,.tag-input,.stage823-inline span,.stage824-money-row span){
  background:#f8fafc !important;
  color:var(--ispforge-modal-ink) !important;
  border-color:var(--ispforge-modal-field-border) !important;
  opacity:1 !important;
}

/* Tabs inside popups: keep active tab readable and professional. */
:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is([class$='-tab'],.stage823-tab,.stage824-tab,.stage825-tab,.stage828-tab,.stage829-tab,.stage8210-tab,.stage8211-tab,.stage8212-tab){
  color:#1d4ed8 !important;
  opacity:1 !important;
}

:is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
) :is([class$='-tab'].active,.stage823-tab.active,.stage824-tab.active,.stage825-tab.active,.stage828-tab.active,.stage829-tab.active,.stage8210-tab.active,.stage8211-tab.active,.stage8212-tab.active){
  color:#111827 !important;
  background:#ffffff !important;
  font-weight:800 !important;
}

/* Dark mode compatibility. */
body.dark :is(
  [data-stage822-modal],
  [data-stage823-modal],
  [data-stage824-modal],
  [data-stage825-modal],
  [data-stage828-modal],
  [data-stage829-modal],
  [data-stage8210-modal],
  [data-stage8211-modal],
  [data-stage8212-modal]
){
  --ispforge-modal-ink:#e5edf7;
  --ispforge-modal-muted:#b6c2d1;
  --ispforge-modal-label:#dbe8f7;
  --ispforge-modal-field-bg:#101827;
  --ispforge-modal-field-border:#334155;
  --ispforge-modal-field-disabled-bg:#1e293b;
  --ispforge-modal-field-disabled-ink:#e2e8f0;
  --ispforge-modal-placeholder:#94a3b8;
}
