/* =====================================================================
   VFGistics — public feedback component (Pre-Phase 35 enhancement)

   A reusable, accessible presentation layer for the success / failure
   messages the application already produces. It is scoped to its own
   `.vf-feedback-*` class names so it cannot affect the existing theme,
   and it reuses the site's own identity (brand red #eb0028, Lato/Raleway
   typography, Font Awesome icons already loaded by the theme).

   It only changes HOW an existing result is presented, never the result.
   ===================================================================== */

.vf-feedback-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2600;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.vf-feedback-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #ececec;
  border-left: 5px solid #eb0028;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  color: #333333;
  font-family: 'Lato', sans-serif;
  animation: vf-feedback-toast-in 0.25s ease both;
}

.vf-feedback-toast.is-success { border-left-color: #1e9e5a; }
.vf-feedback-toast.is-info { border-left-color: #1b8af3; }
.vf-feedback-toast.is-warning { border-left-color: #e0a106; }
.vf-feedback-toast.is-error { border-left-color: #eb0028; }

.vf-feedback-toast__icon {
  flex: 0 0 auto;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1;
}

.vf-feedback-toast.is-success .vf-feedback-toast__icon { color: #1e9e5a; }
.vf-feedback-toast.is-info .vf-feedback-toast__icon { color: #1b8af3; }
.vf-feedback-toast.is-warning .vf-feedback-toast__icon { color: #c98c00; }
.vf-feedback-toast.is-error .vf-feedback-toast__icon { color: #eb0028; }

.vf-feedback-toast__body {
  flex: 1 1 auto;
  min-width: 0;
}

.vf-feedback-toast__title {
  display: block;
  margin: 0 0 2px;
  color: #222222;
  font-family: 'Raleway', sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.vf-feedback-toast__message {
  margin: 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.vf-feedback-toast__close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #999999;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.vf-feedback-toast__close:hover,
.vf-feedback-toast__close:focus {
  background: #f5f5f5;
  color: #222222;
}

/* ---------------------------------------------------------------------
   Dialog (blocking acknowledgement — replaces the native alert)
   --------------------------------------------------------------------- */
.vf-feedback-dialog {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.vf-feedback-dialog[hidden] {
  display: none;
}

.vf-feedback-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.vf-feedback-dialog__panel {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  font-family: 'Lato', sans-serif;
  animation: vf-feedback-dialog-in 0.2s ease both;
}

.vf-feedback-dialog__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #999999;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.vf-feedback-dialog__close:hover,
.vf-feedback-dialog__close:focus {
  background: #f5f5f5;
  color: #222222;
}

.vf-feedback-dialog__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  padding-right: 32px;
}

.vf-feedback-dialog__icon {
  flex: 0 0 auto;
  margin-top: 2px;
  font-size: 30px;
  line-height: 1;
}

.vf-feedback-dialog.is-success .vf-feedback-dialog__icon { color: #1e9e5a; }
.vf-feedback-dialog.is-info .vf-feedback-dialog__icon { color: #1b8af3; }
.vf-feedback-dialog.is-warning .vf-feedback-dialog__icon { color: #c98c00; }
.vf-feedback-dialog.is-error .vf-feedback-dialog__icon { color: #eb0028; }

.vf-feedback-dialog__title {
  margin: 0;
  color: #222222;
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.vf-feedback-dialog__message {
  margin: 0 0 20px;
  color: #555555;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.vf-feedback-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.vf-feedback-dialog__ok {
  min-height: 44px;
}

/* ---------------------------------------------------------------------
   Inline banner (persistent validation feedback inside a form)
   --------------------------------------------------------------------- */
.vf-feedback-inline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 16px;
  background: #fff6f7;
  border: 1px solid #f3c3ca;
  border-left: 5px solid #eb0028;
  border-radius: 4px;
  color: #333333;
  font-family: 'Lato', sans-serif;
}

.vf-feedback-inline.is-success {
  background: #f2fbf6;
  border-color: #bfe6cf;
  border-left-color: #1e9e5a;
}

.vf-feedback-inline.is-info {
  background: #f2f8ff;
  border-color: #c4defb;
  border-left-color: #1b8af3;
}

.vf-feedback-inline.is-warning {
  background: #fffaf0;
  border-color: #f0dcae;
  border-left-color: #e0a106;
}

.vf-feedback-inline__icon {
  flex: 0 0 auto;
  margin-top: 2px;
  font-size: 20px;
  line-height: 1;
  color: #eb0028;
}

.vf-feedback-inline.is-success .vf-feedback-inline__icon { color: #1e9e5a; }
.vf-feedback-inline.is-info .vf-feedback-inline__icon { color: #1b8af3; }
.vf-feedback-inline.is-warning .vf-feedback-inline__icon { color: #c98c00; }

.vf-feedback-inline__body {
  flex: 1 1 auto;
  min-width: 0;
}

.vf-feedback-inline__title {
  display: block;
  margin: 0 0 6px;
  color: #222222;
  font-family: 'Raleway', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.vf-feedback-inline__list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}

.vf-feedback-inline__list li {
  color: #555555;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------
   Animation
   --------------------------------------------------------------------- */
@keyframes vf-feedback-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes vf-feedback-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------------------
   Responsive + accessibility
   --------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  .vf-feedback-toasts {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
  }

  .vf-feedback-dialog {
    padding: 10px;
  }

  .vf-feedback-dialog__panel {
    padding: 20px 16px;
    max-height: calc(100vh - 20px);
  }

  .vf-feedback-dialog__actions {
    flex-direction: column-reverse;
  }

  .vf-feedback-dialog__actions .theme-btn,
  .vf-feedback-dialog__ok {
    width: 100%;
    text-align: center;
  }
}

.vf-feedback-toast__close:focus-visible,
.vf-feedback-dialog__close:focus-visible,
.vf-feedback-dialog__ok:focus-visible {
  outline: 2px solid #eb0028;
  outline-offset: 2px;
}

body.vf-feedback-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .vf-feedback-toast,
  .vf-feedback-dialog__panel {
    animation: none;
  }
}
