/* ============================================================================
   PORTAL ↔ CRM transition: "you're entering / leaving the CRM workspace" modal
   + a full-screen slate curtain that flashes during navigation.
   Loaded by both the main portal and the CRM.
   ============================================================================ */

.pt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease-out;
}
.pt-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pt-modal {
  width: 420px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  color: #0f172a;
  border-radius: 8px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32), 0 2px 6px rgba(15, 23, 42, 0.10);
  border: 1px solid #1e293b;
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.2), opacity .15s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Roboto", "Helvetica Neue", Arial, sans-serif;
}
.pt-modal-backdrop.is-open .pt-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.pt-modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 0;
}
.pt-modal__icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4263c4, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.pt-modal__icon svg { width: 22px; height: 22px; }

.pt-modal__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pt-modal__subtitle {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.pt-modal__body {
  padding: 12px 18px 4px;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}
.pt-modal__body strong { color: #0f172a; font-weight: 600; }
.pt-modal__hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  margin-top: 8px;
}
.pt-modal__kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  background: #f8fafc;
  color: #475569;
}

.pt-modal__actions {
  display: flex;
  gap: 8px;
  padding: 12px 18px 16px;
  justify-content: flex-end;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  margin-top: 12px;
}
.pt-modal__btn {
  font-family: inherit;
  font-size: 13px;
  height: 32px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.pt-modal__btn:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }
.pt-modal__btn--primary {
  background: linear-gradient(180deg, #4263c4, #3853ad);
  color: #fff;
  border-color: #3853ad;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.pt-modal__btn--primary:hover {
  background: linear-gradient(180deg, #4d6fce, #3e5db8);
  border-color: #2a4490;
  color: #fff;
}
.pt-modal__btn svg { width: 14px; height: 14px; }

/* ---- Transition curtain (full-screen fade between portal ↔ CRM) ---- */
.pt-curtain {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #1e293b 0%, #334155 40%, #4263c4 100%);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease-out;
}
.pt-curtain.is-on {
  opacity: 1;
  pointer-events: auto;
}
.pt-curtain__title {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cbd5e1;
}
.pt-curtain__big {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
}
.pt-curtain__bar {
  position: relative;
  width: 220px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.pt-curtain__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #f8fafc, transparent);
  transform: translateX(-100%);
  animation: pt-shimmer 1.1s linear infinite;
}
@keyframes pt-shimmer {
  to { transform: translateX(100%); }
}
.pt-curtain__hint {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

/* ---- Fade-in on first paint, used by both portal & CRM ---- */
body.pt-fade-in { animation: pt-fade-in .25s ease-out both; }
@keyframes pt-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
