/* ERPiran P02 Mailbox-only dark theme hotfix.
   Scoped exclusively to the compose page identified by #mailbox-from. */

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) {
  color: #e2e8f0;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) > header h1 {
  color: #f8fafc !important;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) > header p {
  color: #94a3b8 !important;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) > form {
  background: linear-gradient(145deg, #17253b 0%, #101c2e 100%) !important;
  border: 1px solid #30415a !important;
  border-radius: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
  color: #e2e8f0;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) form label {
  display: inline-block;
  color: #dce6f4 !important;
  font-weight: 500;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) :is(
  #mailbox-from,
  #mailbox-to,
  #mailbox-subject,
  #mailbox-body
) {
  background: #101b2d !important;
  color: #f1f5f9 !important;
  border: 1px solid #34465f !important;
  border-radius: 12px;
  color-scheme: dark;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) :is(
  #mailbox-from,
  #mailbox-to,
  #mailbox-subject,
  #mailbox-body
):focus {
  outline: none !important;
  border-color: #7aa6e8 !important;
  box-shadow: 0 0 0 3px rgba(122, 166, 232, 0.16);
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) :is(
  #mailbox-from,
  #mailbox-to,
  #mailbox-subject,
  #mailbox-body
):disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) :is(
  #mailbox-from,
  #mailbox-to,
  #mailbox-subject,
  #mailbox-body
)::placeholder {
  color: #8192ad;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) #mailbox-from option {
  background: #17253b;
  color: #f1f5f9;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) form [role="alert"] {
  background: rgba(127, 29, 29, 0.17);
  border-color: rgba(248, 113, 113, 0.35) !important;
  color: #fecaca !important;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) form [role="status"] {
  background: rgba(34, 197, 94, 0.09);
  border-color: rgba(74, 222, 128, 0.25) !important;
  color: #bbf7d0 !important;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) form button[type="submit"] {
  background: #426fba !important;
  border: 1px solid #5c87cf;
  color: #ffffff !important;
  transition: background 150ms ease;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) form button[type="submit"]:hover:not(:disabled) {
  background: #5685d2 !important;
}

html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) form button[type="submit"]:disabled {
  background: #334761 !important;
  border-color: #40536b;
  color: #a9b7c9 !important;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  html[data-erpiran-platform-mailbox="true"] section:has(#mailbox-from) > form {
    border-radius: 16px;
    box-shadow: none;
  }
}
