/* XAP360 notices: the pop-up for success, error, warning and info messages (all modules). */
.xapN {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(16, 24, 40, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: xapN-fade .2s ease-out both;
  font-family: "Segoe UI", "Selawik", "Noto Sans Arabic", Verdana, system-ui, sans-serif;
}
.xapN.is-leaving { animation: xapN-fade-out .22s ease-in both; }
.xapN.is-leaving .xapN__card { animation: xapN-card-out .22s ease-in both; }

.xapN__card {
  --c: #12b76a; --soft: #ecfdf3;
  position: relative; overflow: hidden;
  width: min(380px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto;
  background: #fff; border-radius: 18px; text-align: center;
  padding: 1.9rem 1.6rem 1.4rem;
  box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .28), 0 0 0 1px rgba(16, 24, 40, .04);
  animation: xapN-card-in .38s cubic-bezier(.2, 1.2, .4, 1) both;
}
.xapN--error .xapN__card   { --c: #f04438; --soft: #fef3f2; }
.xapN--warning .xapN__card { --c: #f79009; --soft: #fffaeb; }
.xapN--info .xapN__card    { --c: #2e90fa; --soft: #eff8ff; }

/* icon: soft halo, ring that draws itself, then the mark */
.xapN__halo {
  width: 84px; height: 84px; margin: 0 auto .9rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--soft);
  animation: xapN-pop .45s .05s cubic-bezier(.2, 1.4, .4, 1) both;
}
.xapN__icon { width: 60px; height: 60px; display: block; }
.xapN__ring, .xapN__mark { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
.xapN__ring { stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: xapN-draw .6s .1s ease-out forwards; }
.xapN__mark { stroke-width: 4; stroke-dasharray: 48; stroke-dashoffset: 48; animation: xapN-draw .35s .62s ease-out forwards; }
.xapN__dot { fill: var(--c); opacity: 0; animation: xapN-show .2s .62s forwards; }
.xapN--error .xapN__halo { animation: xapN-pop .45s .05s cubic-bezier(.2, 1.4, .4, 1) both, xapN-shake .4s 1s ease-in-out; }

.xapN__title { margin: 0 0 .35rem; font-size: 1.15rem; font-weight: 600; color: #101828; }
.xapN__text { font-size: .9rem; line-height: 1.5; color: #475467; overflow-wrap: anywhere; }
.xapN__text p { margin: 0; }
.xapN__text p + p { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid #f2f4f7; }

.xapN--confirm .xapN__card { --c: #2e90fa; --soft: #eff8ff; }

/* error list: one row per problem, field label first */
.xapN.has-list .xapN__card { width: min(460px, 100%); }
.xapN__list { list-style: none; margin: .7rem 0 0; padding: 0; text-align: start; max-height: 45vh; overflow-y: auto;
  border: 1px solid #fee4e2; border-radius: 10px; background: #fffbfa; }
.xapN__list li { position: relative; padding: .5rem .75rem .5rem 1.9rem; font-size: .85rem; line-height: 1.4; color: #344054; }
[dir="rtl"] .xapN__list li { padding: .5rem 1.9rem .5rem .75rem; }
.xapN__list li + li { border-top: 1px solid #fee4e2; }
.xapN__list li::before { content: ""; position: absolute; inset-inline-start: .8rem; top: .95rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--c); }
.xapN__list b { color: #101828; font-weight: 600; }

/* buttons: Close, or Cancel + Confirm side by side */
.xapN__btns { display: flex; gap: .6rem; margin-top: 1.25rem; }
.xapN__btns button { flex: 1; padding: .6rem 1rem; border-radius: 10px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: filter .15s, transform .1s, background .15s; }
.xapN__ok { border: 0; background: var(--c); color: #fff; }
.xapN__no { border: 1px solid #d0d5dd; background: #fff; color: #344054; }
.xapN__no:hover { background: #f9fafb; }
.xapN__ok:hover { filter: brightness(.93); }
.xapN__btns button:active { transform: scale(.98); }
.xapN__btns button:focus-visible { outline: 3px solid color-mix(in srgb, var(--c) 35%, transparent); outline-offset: 2px; }

/* success / info: time-left bar along the bottom */
.xapN__bar { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: var(--c); opacity: .85; transform-origin: left; }
[dir="rtl"] .xapN__bar { transform-origin: right; }
.xapN--auto .xapN__card { cursor: pointer; }

@keyframes xapN-fade { from { opacity: 0; } }
@keyframes xapN-fade-out { to { opacity: 0; } }
@keyframes xapN-card-in { from { opacity: 0; transform: translateY(14px) scale(.92); } }
@keyframes xapN-card-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes xapN-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes xapN-draw { to { stroke-dashoffset: 0; } }
@keyframes xapN-show { to { opacity: 1; } }
@keyframes xapN-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes xapN-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="always"]) :is(.xapN, .xapN__card, .xapN__halo, .xapN__ring, .xapN__mark, .xapN__dot) { animation-duration: .01s !important; animation-delay: 0s !important; }
}
html[data-motion="off"] :is(.xapN, .xapN__card, .xapN__halo, .xapN__ring, .xapN__mark, .xapN__dot) { animation-duration: .01s !important; animation-delay: 0s !important; }
@media print { .xapN { display: none !important; } }
