/* ==========================================================================
   ROLE POPUP
   Auto-fires once per visitor (8s), asks GC vs Subcontractor, routes to the
   free trial. Segmentation instrument first, conversion second. DOM is built
   by /media/js/role-popup.js; this file styles it. Mirrors the waitlist-modal
   visual language so it feels native.
   ========================================================================== */

.rolepop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.rolepop[data-rolepop-active] {
  opacity: 1;
  pointer-events: auto;
}

.rolepop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rolepop-dialog {
  position: relative;
  width: 100%;
  max-width: 416px;
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 24px 48px -12px rgba(15, 23, 42, 0.18),
    0 48px 96px -24px rgba(15, 23, 42, 0.22);
  transform: translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.rolepop[data-rolepop-active] .rolepop-dialog {
  transform: translateY(0);
}

/* Dark brand bar — carries the logo + trial label across both states */
.rolepop-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 16px 24px;
  background: var(--bg-dark);
}
.rolepop-logo {
  height: 32px;
  width: auto;
  display: block;
}
/* Plain trial label — no status-dot, no pill */
.rolepop-trial {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #cbd5e1;
  white-space: nowrap;
}
.rolepop-close {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.32);
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 0;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}
.rolepop-close:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.rolepop-body {
  padding: 26px 28px 24px;
}
.rolepop-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 9px;
  text-wrap: balance;
}
.rolepop-sub {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 18px;
  max-width: 42ch;
}

/* Role rows — type-led, hairline-separated, sliding arrow */
.rolepop-roles {
  border-top: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.rolepop-role {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 16px 2px;
  border: none;
  border-bottom: 1px solid var(--border-light);
  background: none;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition:
    color 0.15s ease,
    padding-left 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.rolepop-role:hover {
  color: var(--accent-primary);
  padding-left: 8px;
}
.rolepop-role-arrow {
  color: var(--text-light);
  flex-shrink: 0;
  transition:
    color 0.15s ease,
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.rolepop-role:hover .rolepop-role-arrow {
  color: var(--accent-primary);
  transform: translateX(4px);
}

.rolepop-secondary {
  display: inline-block;
  margin-top: 18px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.rolepop-secondary:hover {
  color: var(--text-muted);
}

/* Offer state */
.rolepop-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 14px 22px;
  border-radius: 0;
  background: var(--accent-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  transition:
    background 0.2s ease,
    transform 0.05s ease;
}
.rolepop-cta:hover {
  background: var(--accent-hover);
}
.rolepop-cta:active {
  transform: translateY(1px);
}
.rolepop-reassure {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
}

/* State visibility — script toggles data-rolepop-state on the dialog */
.rolepop-offer {
  display: none;
}
.rolepop-dialog[data-rolepop-state='offer'] .rolepop-ask {
  display: none;
}
.rolepop-dialog[data-rolepop-state='offer'] .rolepop-offer {
  display: block;
}

@media (max-width: 480px) {
  .rolepop-body {
    padding: 22px 22px 20px;
  }
  .rolepop-title {
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rolepop,
  .rolepop-dialog,
  .rolepop-role,
  .rolepop-role-arrow,
  .rolepop-cta {
    transition-duration: 0.01ms;
  }
  .rolepop-role:hover {
    padding-left: 2px;
  }
  .rolepop-role:hover .rolepop-role-arrow {
    transform: none;
  }
}
