/* ==========================================================================
   ILEES error messages - "high voltage": angled navy plates with a red
   live-wire edge, Barlow Condensed headlines and a lightning glyph.
   Loaded last on the dashboard (layouts/sections/css), the login pages,
   the website (front/construction/layout) and the user portal (user/layout).
   Covers: toastr error/warning toasts, SweetAlert2 error popups (and warning
   popups without a Cancel button), field errors and .alert-danger boxes.
   ========================================================================== */
:root {
  --ile-red: #e31b3b;
  --ile-red-dk: #b5122c;
  --ile-amber: #ffb020;
  --ile-navy: #0a1a33;
  --ile-navy-2: #10294d;
  --ile-field: #d4162f;
  --ile-head: "Barlow Condensed", "Oswald", "Arial Narrow", sans-serif;
  --ile-body: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --ile-bolt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M13.5 1 4 14h6.5L9 23l11-14h-7z'/%3E%3C/svg%3E");
}
body.dark-only { --ile-field: #ff5470; }

/* ---------- toasts ---------- */
#toast-container > .toast.toast-error,
#toast-container > .toast.toast-warning {
  position: relative; width: 350px; max-width: calc(100vw - 24px); overflow: hidden;
  padding: 16px 18px 16px 70px !important; padding-inline-start: 70px !important; padding-inline-end: 34px !important; opacity: 1 !important;
  background: linear-gradient(115deg, var(--ile-navy) 0%, var(--ile-navy-2) 100%) !important; background-image: linear-gradient(115deg, var(--ile-navy) 0%, var(--ile-navy-2) 100%) !important;
  color: #dbe4f3 !important; border: 0 !important; border-radius: 0 !important;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  box-shadow: 0 24px 50px -20px rgba(10, 26, 51, .7) !important; font-family: var(--ile-body);
}
#toast-container > .toast.toast-error::before,
#toast-container > .toast.toast-warning::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 54px;
  background: var(--ile-bolt) center / 24px no-repeat, var(--ile-red);
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
}
[dir="rtl"] #toast-container > .toast::before, #toast-container > .toast.rtl::before { clip-path: polygon(0 0, 100% 0, 100% 100%, 22% 100%); }
#toast-container > .toast.toast-warning::before { background: var(--ile-bolt) center / 24px no-repeat, var(--ile-amber); }
#toast-container > .toast-error .toast-title,
#toast-container > .toast-warning .toast-title { font: 800 20px/1.05 var(--ile-head); text-transform: uppercase; letter-spacing: .06em; color: #fff; margin-bottom: 4px; }
#toast-container > .toast-error .toast-message,
#toast-container > .toast-warning .toast-message { font-size: 13.5px; line-height: 1.5; color: #c4d0e4; }
#toast-container > .toast-error .toast-close-button,
#toast-container > .toast-warning .toast-close-button { position: absolute; top: 10px; inset-inline-end: 14px; color: #fff; opacity: .7; text-shadow: none; }
#toast-container > .toast-error .toast-progress { height: 3px; opacity: 1; background: linear-gradient(90deg, var(--ile-red), #ff6b84); box-shadow: 0 0 10px var(--ile-red); }
#toast-container > .toast-warning .toast-progress { height: 3px; opacity: 1; background: var(--ile-amber); }

/* ---------- popups ---------- */
.swal2-popup.swal2-icon-error,
.swal2-popup.swal2-icon-warning:has(.swal2-cancel[style*="none"]) {
  background: linear-gradient(160deg, var(--ile-navy) 0%, var(--ile-navy-2) 100%) !important; color: #c4d0e4 !important;
  border-radius: 0 !important; border-top: 5px solid var(--ile-red) !important; font-family: var(--ile-body);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8) !important;
}
.swal2-popup.swal2-icon-warning:has(.swal2-cancel[style*="none"]) { border-top-color: var(--ile-amber) !important; }
.swal2-popup.swal2-icon-error .swal2-title,
.swal2-popup.swal2-icon-warning:has(.swal2-cancel[style*="none"]) .swal2-title { color: #fff !important; font: 800 30px/1.05 var(--ile-head) !important; text-transform: uppercase; letter-spacing: .05em; }
.swal2-popup.swal2-icon-error .swal2-html-container,
.swal2-popup.swal2-icon-warning:has(.swal2-cancel[style*="none"]) .swal2-html-container { color: #c4d0e4 !important; }
.swal2-popup.swal2-icon-error .swal2-icon.swal2-error {
  border: 0 !important; border-radius: 0; background: var(--ile-bolt) center / 46px no-repeat, var(--ile-red);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: none;
}
.swal2-popup.swal2-icon-error .swal2-icon.swal2-error .swal2-x-mark { display: none; }
.swal2-popup.swal2-icon-error .swal2-confirm,
.swal2-popup.swal2-icon-warning:has(.swal2-cancel[style*="none"]) .swal2-confirm {
  background: var(--ile-red) !important; color: #fff !important; border: 0 !important; border-radius: 0 !important;
  padding: 12px 30px !important; font: 700 16px/1 var(--ile-head) !important; letter-spacing: .14em; text-transform: uppercase;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); box-shadow: none !important;
}

/* ---------- field errors ---------- */
.invalid-feedback, p.text-danger:not(:empty), small.text-danger:not(:empty), label.error {
  position: relative; margin-top: 6px; padding-inline-start: 22px;
  color: var(--ile-field) !important; font: 700 14px/1.3 var(--ile-head); text-transform: uppercase; letter-spacing: .05em;
}
.invalid-feedback::before, p.text-danger:not(:empty)::before, small.text-danger:not(:empty)::before, label.error::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0; width: 15px; height: 17px;
  background: var(--ile-bolt) center / 11px no-repeat, var(--ile-red); clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
}
.form-control.is-invalid, .form-select.is-invalid, .was-validated .form-control:invalid {
  border-color: var(--ile-red) !important; background-image: none !important;
  box-shadow: 0 2px 0 var(--ile-red), 0 6px 14px -8px rgba(227, 27, 59, .7) !important;
}

/* ---------- boxed alerts ---------- */
.alert.alert-danger {
  position: relative; padding: 14px 18px; padding-inline-start: 62px;
  color: #dbe4f3 !important; background: linear-gradient(115deg, var(--ile-navy), var(--ile-navy-2)) !important;
  border: 0 !important; border-radius: 0 !important; font-family: var(--ile-body);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.alert.alert-danger::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 46px;
  background: var(--ile-bolt) center / 20px no-repeat, var(--ile-red);
}
.alert.alert-danger a, .alert.alert-danger strong, .alert.alert-danger .alert-link { color: #fff !important; }
