/* portal-confirm — shared, on-brand confirmation dialog that replaces the
   browser-default window.confirm(). Driven by public/js/portal-confirm.js.
   Matches the iGOLD portal theme (navy header, gold/red accents). */

.pc-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.pc-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
body.pc-modal-open {
  overflow: hidden;
}

.pc-modal {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32);
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  font-family: 'Sora', 'Poppins', system-ui, sans-serif;
}
.pc-overlay.is-open .pc-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header */
.pc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f172a 100%);
  color: #fff;
}
.pc-header__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  min-width: 0;
}
.pc-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 1rem;
  flex: 0 0 auto;
}
.pc-header__title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-close {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s;
}
.pc-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Body */
.pc-body {
  padding: 1.25rem 1.25rem 1.1rem;
  background: #f8fafc;
}
.pc-message {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #1f2937;
  margin: 0;
}
.pc-subtext {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #64748b;
}

/* Footer / actions */
.pc-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  padding: 0.95rem 1.25rem 1.15rem;
  background: #fff;
  border-top: 1px solid #eef2f7;
}
.pc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 10px;
  padding: 0.6rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
}
.pc-btn:active {
  transform: translateY(1px);
}
.pc-btn--cancel {
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
}
.pc-btn--cancel:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.pc-btn--confirm {
  color: #fff;
}

/* Accent variants (driven by data-confirm-type) */
.pc-modal[data-type="danger"] .pc-header__icon { background: rgba(248, 113, 113, 0.22); color: #fecaca; }
.pc-modal[data-type="danger"] .pc-btn--confirm { background: #b91c1c; box-shadow: 0 4px 14px rgba(185, 28, 28, 0.35); }
.pc-modal[data-type="danger"] .pc-btn--confirm:hover { background: #991b1b; }

.pc-modal[data-type="primary"] .pc-header__icon { background: rgba(96, 165, 250, 0.22); color: #bfdbfe; }
.pc-modal[data-type="primary"] .pc-btn--confirm { background: #2563eb; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32); }
.pc-modal[data-type="primary"] .pc-btn--confirm:hover { background: #1d4ed8; }

.pc-modal[data-type="success"] .pc-header__icon { background: rgba(52, 211, 153, 0.22); color: #bbf7d0; }
.pc-modal[data-type="success"] .pc-btn--confirm { background: #16a34a; box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3); }
.pc-modal[data-type="success"] .pc-btn--confirm:hover { background: #15803d; }

.pc-modal[data-type="gold"] .pc-header__icon { background: rgba(212, 175, 55, 0.25); color: #f5e6a3; }
.pc-modal[data-type="gold"] .pc-btn--confirm { background: #d4af37; color: #1a1a2e; box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4); }
.pc-modal[data-type="gold"] .pc-btn--confirm:hover { background: #c69f2f; }

.pc-modal[data-type="warning"] .pc-header__icon { background: rgba(251, 191, 36, 0.22); color: #fde68a; }
.pc-modal[data-type="warning"] .pc-btn--confirm { background: #d97706; box-shadow: 0 4px 14px rgba(217, 119, 6, 0.32); }
.pc-modal[data-type="warning"] .pc-btn--confirm:hover { background: #b45309; }

.pc-btn--confirm[disabled] {
  opacity: 0.6;
  cursor: progress;
}

@media (max-width: 480px) {
  .pc-actions { flex-direction: column-reverse; }
  .pc-btn { width: 100%; justify-content: center; }
}
