/* ============================================================
   tf-modal — branded confirm/alert dialog
   Replaces native window.confirm / window.alert.
   Used by both admin and public pages.
   ============================================================ */

.tfm-bg {
  position: fixed; inset: 0;
  background: rgba(15, 27, 45, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
}
.tfm-bg.is-open { opacity: 1; pointer-events: auto; }

.tfm-dialog {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, calc(-50% + 8px)) scale(.97);
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: #fff; color: var(--ink, #1F3751);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 27, 45, .35);
  z-index: 9999;
  display: flex; flex-direction: column;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  overflow: hidden;
}
.tfm-dialog.is-open {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.tfm-head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 22px 0;
}
.tfm-icon {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Material Symbols Outlined';
  font-size: 24px; line-height: 1;
  background: var(--brand-primary-soft, #E3F2FA);
  color: var(--brand-primary, #1D88C0);
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
.tfm-dialog.is-danger .tfm-icon {
  background: rgba(200, 30, 44, .10);
  color: var(--danger, #C81E2C);
}
.tfm-title {
  margin: 0;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 16px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  line-height: 1.2;
}

.tfm-body {
  padding: 12px 22px 4px;
  font-size: 14px; line-height: 1.55;
  color: var(--ink-soft, #5A6779);
  overflow-y: auto;
}
.tfm-body strong { color: var(--ink, #1F3751); }

.tfm-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 18px 22px 22px;
  flex-wrap: wrap;
}
.tfm-btn {
  appearance: none; -webkit-appearance: none;
  border: 1px solid transparent;
  padding: 10px 18px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  letter-spacing: .4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  min-height: 40px;
}
.tfm-btn:active { transform: translateY(1px); }
.tfm-btn-cancel {
  background: #fff; color: var(--ink, #1F3751);
  border-color: #D8DEE6;
}
.tfm-btn-cancel:hover { background: var(--mist, #F5F7FA); border-color: #B7C0CC; }
.tfm-btn-ok {
  background: var(--brand-primary, #1D88C0); color: #fff;
}
.tfm-btn-ok:hover { background: var(--brand-primary-dark, #1671A4); }
.tfm-dialog.is-danger .tfm-btn-ok {
  background: var(--danger, #C81E2C);
}
.tfm-dialog.is-danger .tfm-btn-ok:hover { background: #A0151F; }

@media (max-width: 480px) {
  .tfm-dialog { width: calc(100vw - 24px); border-radius: 12px; }
  .tfm-head { padding: 18px 18px 0; gap: 12px; }
  .tfm-icon { width: 38px; height: 38px; font-size: 20px; }
  .tfm-title { font-size: 14px; }
  .tfm-body { padding: 10px 18px 0; font-size: 13.5px; }
  .tfm-foot { padding: 14px 18px 18px; }
  .tfm-foot .tfm-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .tfm-bg, .tfm-dialog { transition: none; }
}
