/* Shared notice component. Error and success dialogs use scoped button designs. */
.ofp-notice-host {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(21, 35, 58, .42);
  isolation: isolate;
}

.ofp-notice {
  --ofp-status: #096aff;
  --ofp-tint: #edf4ff;
  box-sizing: border-box;
  max-width: 100%;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dce4ef;
  border-radius: 16px;
  background: #fff;
  color: #203047;
  box-shadow: 0 24px 80px rgba(15, 33, 61, .2);
  font-family: inherit;
  text-align: left;
  line-height: 1.5;
}

.ofp-notice--warning { --ofp-status: #9c5910; --ofp-tint: #fff5e8; }
.ofp-notice--error {
  --ofp-status: #e00000;
  --ofp-tint: #fff1f2;
  --ofp-accent: #e00000;
  --ofp-accent-strong: #a60000;
  --ofp-accent-text: #923131;
  --ofp-accent-tint: #fff8f9;
  --ofp-accent-border: #f0dce0;
  --ofp-accent-hover: #bd0000;
  background: #fffdfd;
  border-color: #f0e3e6;
}
.ofp-notice--success {
  --ofp-status: #03e456;
  --ofp-tint: #edf8f1;
  --ofp-accent: #03e456;
  --ofp-accent-strong: #145c3c;
  --ofp-accent-text: #36664c;
  --ofp-accent-tint: #f6fbf8;
  --ofp-accent-border: #d9eade;
  --ofp-accent-hover: #02c64b;
  --ofp-button-text: #064a22;
  background: #fcfefc;
  border-color: #e1ece5;
}
.ofp-notice__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 0;
}
.ofp-notice__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 5px;
  background: var(--ofp-tint);
  color: var(--ofp-status);
  font-size: 12px;
  font-weight: 600;
}
.ofp-notice__status .bi { font-size: 14px; }
.ofp-notice__body { padding: 20px 28px 26px; }
.ofp-notice .ofp-notice__title {
  margin: 0;
  color: #203047;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.4px;
  overflow-wrap: anywhere;
}
.ofp-notice__content {
  margin-top: 12px;
  color: #58677c;
  font-size: 15px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.ofp-notice__content > :last-child { margin-bottom: 0; }
.ofp-notice__content img, .ofp-notice__content video { max-width: 100%; height: auto; }
.ofp-notice__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 28px;
  border-top: 1px solid #e7edf4;
  background: #f8fafd;
}
.ofp-notice__hint { flex: 1 1 160px; color: #68778b; font-size: 12px; }
.ofp-notice__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.ofp-notice__progress { height: 4px; margin-top: 24px; overflow: hidden; border-radius: 2px; background: #e8eef7; }
.ofp-notice__progress-bar { display: block; height: 100%; background: #096aff; }
.ofp-notice__progress--pending .ofp-notice__progress-bar { width: 35%; animation: ofp-notice-progress 1.6s ease-in-out infinite; }
.ofp-notice--loading .ofp-notice__body { padding: 36px 28px; text-align: center; }
.ofp-notice--loading .ofp-notice__progress { height: 14px; border-radius: 7px; }
.ofp-notice--loading .ofp-notice__progress-bar { border-radius: inherit; background: linear-gradient(90deg, #096aff, #4aa8ff); }
.ofp-notice-host--loading, .ofp-notice-host--error, .ofp-notice-host--success { animation: ofp-notice-enter .18s ease-out; }
.ofp-notice-host--error, .ofp-notice-host--success {
  --ofp-symbol-size: 112px;
  --ofp-symbol-overhang: 56px;
  --ofp-notice-gutter: 24px;
  padding-top: calc(var(--ofp-notice-gutter) + var(--ofp-symbol-overhang));
  background: rgba(21, 35, 58, .36);
}
.ofp-notice--outcome { position: relative; max-height: none; overflow: visible; }
.ofp-notice__outcome-scroll {
  max-height: calc(100dvh - var(--ofp-symbol-overhang) - var(--ofp-notice-gutter) - var(--ofp-notice-gutter) - 2px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
}
.ofp-notice--outcome .ofp-notice__body { padding: calc(var(--ofp-symbol-overhang) + 24px) 28px 28px; text-align: center; }
.ofp-notice--outcome .ofp-notice__title { color: var(--ofp-accent-strong); font-size: 22px; line-height: 1.45; }
.ofp-notice--outcome .ofp-notice__content { color: var(--ofp-accent-text); font-size: 16px; }
.ofp-notice--outcome .ofp-notice__title[hidden] + .ofp-notice__content { margin-top: 0; color: var(--ofp-accent-strong); font-size: 20px; font-weight: 500; line-height: 1.45; }
.ofp-notice--outcome .ofp-notice__footer { background: var(--ofp-accent-tint); border-color: var(--ofp-accent-border); }
.ofp-notice--outcome .ofp-notice__hint, .ofp-notice--outcome .ofp-notice__details { color: var(--ofp-accent-text); }
.ofp-notice--outcome .ofp-notice__progress { background: var(--ofp-accent-border); }
.ofp-notice--outcome .ofp-notice__progress-bar { background: var(--ofp-accent); }
.ofp-notice__outcome-symbol {
  position: absolute;
  top: calc(0px - var(--ofp-symbol-overhang));
  left: calc(50% - var(--ofp-symbol-overhang));
  z-index: 1;
  display: block;
  width: var(--ofp-symbol-size);
  height: var(--ofp-symbol-size);
  margin: 0;
  color: var(--ofp-accent);
}
.ofp-notice__outcome-symbol--error { animation: ofp-notice-error-nudge .45s ease-out; }
.ofp-notice__outcome-symbol--success { animation: ofp-notice-success-settle .45s ease-out; }
.ofp-notice__outcome-surface { fill: var(--ofp-tint); }
.ofp-notice__outcome-outline, .ofp-notice__outcome-mark { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; }
.ofp-notice__outcome-outline { animation: ofp-notice-outcome-draw .55s ease-out both; }
.ofp-notice__outcome-mark { animation: ofp-notice-outcome-draw .25s ease-out .2s both; }
.ofp-notice__outcome-dot { fill: currentColor; }
/* These outcome designs explicitly override framework.css buttons. */
.ofp-notice--outcome .ofp-notice__button {
  box-sizing: border-box;
  min-width: 108px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ofp-accent);
  border-radius: 8px;
  background: var(--ofp-accent) !important;
  color: var(--ofp-button-text, #fff) !important;
  box-shadow: 0 2px 4px rgba(20, 35, 30, .1);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 42px;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.ofp-notice--outcome .ofp-notice__button:hover { background: var(--ofp-accent-hover) !important; border-color: var(--ofp-accent-hover); color: var(--ofp-button-text, #fff) !important; box-shadow: 0 2px 4px rgba(20, 35, 30, .1); transform: none; opacity: 1; }
.ofp-notice--outcome .ofp-notice__button--secondary { background: var(--ofp-accent-tint) !important; border-color: var(--ofp-accent-border); color: var(--ofp-accent-hover) !important; box-shadow: none; }
.ofp-notice--outcome .ofp-notice__button--secondary:hover { background: var(--ofp-tint) !important; border-color: var(--ofp-accent); color: var(--ofp-accent-strong) !important; box-shadow: none; }
.ofp-notice--outcome .ofp-notice__button:focus-visible { outline: 2px solid var(--ofp-accent-hover); outline-offset: 3px; }
.ofp-notice__percentage { display: block; margin-top: 10px; color: #68778b; font-size: 13px; font-variant-numeric: tabular-nums; }
.ofp-notice__details { margin-top: 18px; color: #58677c; font-size: 13px; }
.ofp-notice__details summary { cursor: pointer; font-weight: 600; }
.ofp-notice__details pre { max-height: 180px; overflow: auto; margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.ofp-notice__validation { margin-top: 16px; padding: 12px; border-left: 3px solid #b74a36; background: #fff3ef; color: #9f3624; font-size: 14px; }
.ofp-notice [hidden] { display: none !important; }
.ofp-notice:focus { outline: none; }
.ofp-notice__details summary:focus-visible, .ofp-notice__validation:focus-visible { outline: 2px solid #096aff; outline-offset: 4px; }

@keyframes ofp-notice-progress { from { transform: translateX(-100%); } to { transform: translateX(390%); } }
@keyframes ofp-notice-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes ofp-notice-outcome-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes ofp-notice-error-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-1px); } }
@keyframes ofp-notice-success-settle { from { transform: translateY(3px); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .ofp-notice__progress--pending .ofp-notice__progress-bar { animation: none; width: 100%; }
  .ofp-notice-host--loading, .ofp-notice-host--error, .ofp-notice-host--success,
  .ofp-notice__outcome-symbol, .ofp-notice__outcome-outline, .ofp-notice__outcome-mark { animation: none; }
  .ofp-notice--outcome .ofp-notice__button { transition: none; }
}
@media (max-width: 575px) {
  .ofp-notice-host { padding: 16px; }
  .ofp-notice-host--error, .ofp-notice-host--success {
    --ofp-symbol-size: 96px;
    --ofp-symbol-overhang: 48px;
    --ofp-notice-gutter: 16px;
    padding-top: calc(var(--ofp-notice-gutter) + var(--ofp-symbol-overhang));
  }
  .ofp-notice { max-height: calc(100dvh - 32px); border-radius: 12px; }
  .ofp-notice__header { padding: 20px 20px 0; gap: 10px; }
  .ofp-notice__body { padding: 18px 20px 22px; }
  .ofp-notice .ofp-notice__title { font-size: 21px; }
  .ofp-notice__footer { padding: 16px 20px; }
}
@media print { .ofp-notice-host { display: none; } }

/* Shared, non-blocking download status. */
.download-toast {
  box-sizing: border-box;
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 20001;
  width: 370px;
  max-width: calc(100vw - 48px);
  padding: 16px 18px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
  font-family: inherit;
  text-align: left;
}
.download-toast[hidden] { display: none !important; }
.download-toast-content { display: flex; align-items: flex-start; gap: 12px; }
.download-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  color: #2563eb;
  font-size: 26px;
  line-height: 1.4;
}
.download-toast-title { margin-bottom: 6px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.download-toast-message { color: #4b5563; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .download-toast { top: 16px; right: 16px; left: 16px; width: auto; max-width: none; }
}
@media print { .download-toast { display: none !important; } }
