/*
  ISP Forge Stage 105.2M CLEAN
  Global Popup Placeholder / Field Hint Neutral Text Cleanup

  Purpose:
  - Remove the remaining blue-tinted placeholder / field hint writing inside popups.
  - Keep the confirmed 105.2L popup/form contrast improvements.
  - Keep popup save/cancel/close behaviour untouched.
  - Avoid page layout, route, backend, database, API, or app.js changes.
*/

:root{
  --ispforge-modal-placeholder-neutral:#475569;
  --ispforge-modal-placeholder-neutral-soft:#5b6472;
  --ispforge-modal-placeholder-neutral-dark:#334155;
}

/* Known customer / data-account modal families plus common platform dialog wrappers. */
: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],
  .modal,
  .popup,
  .dialog,
  [role="dialog"]
) :is(input,textarea)::placeholder{
  color:var(--ispforge-modal-placeholder-neutral) !important;
  -webkit-text-fill-color:var(--ispforge-modal-placeholder-neutral) !important;
  opacity:.82 !important;
  text-shadow:none !important;
}

/* Some select/custom-select placeholders are actual selected options or rendered spans, not ::placeholder. */
: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],
  .modal,
  .popup,
  .dialog,
  [role="dialog"]
) :is(
  select:invalid,
  option[value=""],
  option[disabled],
  .select2-selection__placeholder,
  .choices__placeholder,
  .choices__item--choice.is-placeholder,
  .multiselect__placeholder,
  .tag-input__placeholder,
  [data-placeholder],
  .placeholder,
  .input-placeholder,
  .form-placeholder
){
  color:var(--ispforge-modal-placeholder-neutral) !important;
  -webkit-text-fill-color:var(--ispforge-modal-placeholder-neutral) !important;
  opacity:.86 !important;
  text-shadow:none !important;
}

/* Grey readonly/disabled fields with empty placeholder text should remain neutral, not blue. */
: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],
  .modal,
  .popup,
  .dialog,
  [role="dialog"]
) :is(input,textarea):is(:disabled,[readonly])::placeholder{
  color:var(--ispforge-modal-placeholder-neutral-dark) !important;
  -webkit-text-fill-color:var(--ispforge-modal-placeholder-neutral-dark) !important;
  opacity:.78 !important;
}

/* Date fields and generated controls can inherit browser placeholder tint. */
: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],
  .modal,
  .popup,
  .dialog,
  [role="dialog"]
) :is(input[type="date"],input[type="datetime-local"],input[type="month"],input[type="time"]){
  color-scheme:light;
}

/* Keep real values readable and neutral in custom select/search controls. */
: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],
  .modal,
  .popup,
  .dialog,
  [role="dialog"]
) :is(.select2-selection__rendered,.choices__list--single,.choices__item,.multiselect__single){
  color:#1f2937 !important;
  -webkit-text-fill-color:#1f2937 !important;
  opacity:1 !important;
}

/* Dark mode support, should a modal open while dark mode is active. */
body.dark{
  --ispforge-modal-placeholder-neutral:#aab6c5;
  --ispforge-modal-placeholder-neutral-soft:#9aa8ba;
  --ispforge-modal-placeholder-neutral-dark:#cbd5e1;
}

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],
  .modal,
  .popup,
  .dialog,
  [role="dialog"]
) :is(.select2-selection__rendered,.choices__list--single,.choices__item,.multiselect__single){
  color:#e5edf7 !important;
  -webkit-text-fill-color:#e5edf7 !important;
}
