/* Writer invite modal — فوق واجهة الموقع */

body.janoob-wi-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

.janoob-wi-modal {
  position: fixed;
  inset: 0;
  z-index: 1000010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(0.75rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
  transition: opacity 0.28s ease;
}

.janoob-wi-modal:not(.hidden) {
  display: flex;
}

.janoob-wi-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.janoob-wi-modal__panel {
  position: relative;
  z-index: 2;
  width: min(100%, 26rem);
  max-height: min(92dvh, 44rem);
  overflow: auto;
  border-radius: 1.35rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  box-shadow:
    0 0 0 1px rgb(227 0 15 / 0.08),
    0 28px 80px -16px rgba(0, 0, 0, 0.45);
  padding: 1.25rem 1rem 1rem;
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
}

.janoob-wi-modal__panel.is-visible {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.janoob-wi-modal__close {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 9999px;
  background: #e3000f;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgb(227 0 15 / 0.45);
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.janoob-wi-modal__close:hover,
.janoob-wi-modal__close:focus-visible {
  filter: brightness(1.08);
  transform: scale(1.05);
}

.janoob-wi-modal__close svg {
  width: 1.15rem;
  height: 1.15rem;
}

.janoob-wi-modal__chrome {
  text-align: center;
  padding: 0.25rem 0.5rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border) / 0.65);
  margin-bottom: 0.75rem;
}

.janoob-wi-modal__eyebrow {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #e3000f;
}

.janoob-wi-modal__title {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: hsl(var(--foreground));
}

.janoob-wi-modal__lead {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

.janoob-wi-modal__confirm {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border-radius: inherit;
  background: hsl(var(--background) / 0.97);
  text-align: center;
}

.janoob-wi-modal__confirm[hidden] {
  display: none !important;
}

.janoob-wi-modal__confirm-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: hsl(var(--foreground));
}

.janoob-wi-modal__confirm-text {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.6;
  color: #e3000f;
}

.janoob-wi-modal__confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 16rem;
  margin-top: 0.35rem;
}

.janoob-wi-wizard--hub {
  min-height: auto;
  gap: 0.65rem;
  padding-bottom: 0.35rem;
}

.janoob-wi-wizard--hub .janoob-wi-stage {
  justify-content: flex-start;
}

.janoob-wi-progress--hidden {
  display: none !important;
}

.janoob-wi-hub-trust {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: hsl(var(--muted-foreground));
}

.janoob-wi-social-stack--hub {
  margin-top: 0.65rem;
}

.janoob-wi-social-stack--hub .janoob-wi-btn--google {
  min-height: 3.1rem;
  font-size: 0.95rem;
}

.janoob-wi-email-block {
  margin-top: 0.15rem;
}

.janoob-wi-btn--email {
  min-height: 2.85rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgb(227 0 15 / 0.2);
}

.janoob-wi-links--hub {
  margin-top: 0.35rem;
}

.janoob-wi-status {
  margin: 0.5rem 0 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid hsl(var(--border));
  text-align: center;
}

.janoob-wi-status--new {
  border-color: rgb(59 130 246 / 0.35);
  background: rgb(59 130 246 / 0.08);
}

.janoob-wi-status--existing {
  border-color: rgb(227 0 15 / 0.35);
  background: rgb(227 0 15 / 0.07);
}

.janoob-wi-status--pending {
  border-color: rgb(245 158 11 / 0.45);
  background: rgb(245 158 11 / 0.1);
}

.janoob-wi-status--linked {
  border-color: rgb(5 150 105 / 0.4);
  background: rgb(5 150 105 / 0.1);
}

.janoob-wi-status--mismatch {
  border-color: rgb(220 38 38 / 0.45);
  background: rgb(220 38 38 / 0.08);
}

.janoob-wi-mismatch-row {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.55;
  color: hsl(var(--foreground));
}

.janoob-wi-mismatch-row strong {
  color: #e3000f;
  font-weight: 900;
}

.janoob-wi-social-pick {
  margin: 0 0 0.45rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

.janoob-wi-btn--block {
  width: 100%;
  margin-top: 0.5rem;
}

.janoob-wi-status__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 900;
  color: hsl(var(--foreground));
}

.janoob-wi-status__body {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

.janoob-wi-status__note {
  margin: 0.45rem 0 0;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.5;
  color: hsl(var(--muted-foreground) / 0.9);
}

.janoob-nt-login-link--invite-pending {
  position: relative;
  border-color: rgb(227 0 15 / 0.35) !important;
  background: rgb(227 0 15 / 0.06) !important;
}

.janoob-nt-login-link--invite-pending::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #e3000f;
  box-shadow: 0 0 0 2px hsl(var(--background));
}

.janoob-nt-avatar-guest {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 9999px;
  background: linear-gradient(145deg, rgb(227 0 15 / 0.12), rgb(227 0 15 / 0.04));
  color: #e3000f;
  border: 1.5px solid rgb(227 0 15 / 0.28);
}

.janoob-nt-avatar-guest svg {
  width: 1rem;
  height: 1rem;
}
