/* The app's confirm window (utils/confirmDialog.js: «پایان جلسه برای همه؟», delete, archive …) in
 * the Asmeli look: a rounded white card on a soft, slightly blurred backdrop, a red-tinted icon,
 * pill buttons with a solid red confirm. Self-contained, so pages without styles.css (the meeting
 * guest page) show it properly too. On phones it floats at the bottom, within thumb reach.
 * Loaded after styles.css; lite-mode.css (loaded last) removes the blur.
 */
.app-confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: inherit;
}

.app-confirm-dialog .app-confirm-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  cursor: default;
  background: rgba(16, 25, 43, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.app-confirm-dialog .app-confirm-panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--as-radius-2xl, 24px);
  background: var(--as-surface, #ffffff);
  box-shadow: var(--as-shadow-4, 0 24px 64px rgba(16, 25, 43, 0.24));
  color: var(--as-text, #10192b);
  text-align: center;
}

.app-confirm-dialog .app-confirm-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--as-danger-subtle, #fff4f3);
  box-shadow: 0 0 0 6px rgba(199, 45, 49, 0.07);
  color: var(--as-danger, #c72d31);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.app-confirm-dialog .app-confirm-panel h2 {
  margin: 2px 0 4px;
  color: var(--as-text, #10192b);
  font-size: var(--as-text-title-sm, 1.25rem);
  font-weight: 700;
  line-height: var(--as-leading-title-sm, 1.35);
  overflow-wrap: anywhere;
}

.app-confirm-dialog .app-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.app-confirm-dialog .app-confirm-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--as-radius-full, 999px);
  font: inherit;
  font-size: var(--as-text-body-sm, 0.875rem);
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.app-confirm-dialog .app-confirm-actions > [data-confirm-no] {
  background: var(--as-surface-sunken, #f8fafe);
  border-color: #dbe3f3;
  color: var(--as-text, #10192b);
}

.app-confirm-dialog .app-confirm-actions > [data-confirm-no]:hover {
  background: #eef2fb;
}

.app-confirm-dialog .app-confirm-actions > [data-confirm-yes] {
  background: var(--as-danger, #c72d31);
  color: #ffffff;
  box-shadow: 0 10px 22px -10px rgba(199, 45, 49, 0.7);
}

.app-confirm-dialog .app-confirm-actions > [data-confirm-yes]:hover {
  background: var(--as-danger-text, #a91c23);
}

.app-confirm-dialog .app-confirm-actions > button:active {
  transform: scale(0.98);
}

.app-confirm-dialog .app-confirm-actions > button:focus-visible {
  outline: 2px solid var(--as-focus-ring, #1f6fd1);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--as-focus-ring-halo, rgba(31, 111, 209, 0.28));
}

/* Phones: a floating card at the bottom. */
@media (max-width: 520px) {
  .app-confirm-dialog {
    align-items: flex-end;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  }

  .app-confirm-dialog .app-confirm-panel {
    padding: 24px 18px 18px;
  }
}

@keyframes app-confirm-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes app-confirm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  html:not(.as-lite) .app-confirm-dialog .app-confirm-backdrop {
    animation: app-confirm-fade 0.18s ease-out both;
  }

  html:not(.as-lite) .app-confirm-dialog .app-confirm-panel {
    animation: app-confirm-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
}
