/**
 * GAPAT shared ecosystem shell — match Vault Education (portal.html + gapat-theme).
 * Header floats over page content (fixed, no opaque bar).
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --gapat-shell-bg: #08080f;
  --gapat-shell-text: #f1f5f9;
  --gapat-shell-muted: #94a3b8;
  --gapat-shell-pink: #ec4899;
  --gapat-shell-purple: #a855f7;
  --gapat-shell-glass: rgba(255, 255, 255, 0.09);
  --gapat-shell-border: rgba(255, 255, 255, 0.2);
  --gapat-shell-font: 'Outfit', 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  /* Match the larger Risk pill; logo + account sized to it */
  --gapat-chrome-size: 48px;
  --gapat-chrome-pad: 0.375rem;
  --gapat-chrome-font: 0.9375rem;
  --gapat-chrome-gap: 0.25rem;
  --gapat-chrome-tab-pad-y: 0.5rem;
  --gapat-chrome-tab-pad-x: 1rem;
}

/* Soften cross-subdomain tab hops (Education <-> Risk) */
html.gapat-leaving,
html.gapat-leaving body {
  background: var(--gapat-shell-bg) !important;
}

html.gapat-leaving .gapat-shell-root {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gapat-shell-root {
  min-height: 100vh;
  font-family: var(--gapat-shell-font);
  color: var(--gapat-shell-text);
  background: transparent;
}

/* Floating top bar — logo left, pill center, account right (same as Vault) */
.gapat-shell-root .top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
  pointer-events: none;
  background: transparent;
  font-family: var(--gapat-shell-font);
  font-size: 16px; /* neutralize Tailwind / rem scaling differences vs Vault */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.gapat-shell-root .top-bar > * {
  pointer-events: auto;
}

.gapat-shell-root .top-bar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.55rem;
  justify-self: start;
  text-decoration: none;
}

.gapat-shell-root .top-bar-logo img {
  display: block;
  /* Custom G + VAULT lockup (same asset as vault landing / Risk) */
  width: auto;
  height: clamp(40px, 5.2vw, 52px);
  max-width: min(280px, 46vw);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.55));
}

@media (max-width: 900px) {
  .gapat-shell-root .top-bar-logo img {
    height: 34px;
    max-width: min(200px, 48vw);
  }
}

.gapat-shell-root .vault-wordmark__text {
  font-family: 'Space Grotesk', 'Outfit', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background: none;
}

.gapat-shell-root .top-bar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  min-width: 44px;
  justify-self: end;
}

.gapat-shell-root .top-bar-right a {
  text-decoration: none !important;
}

/* Floating glass nav pill — match Vault Education / larger Risk size */
.gapat-shell-root .glass-pill {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: var(--gapat-chrome-gap);
  width: auto;
  max-width: min(720px, calc(100vw - 220px));
  min-height: var(--gapat-chrome-size);
  height: auto;
  padding: var(--gapat-chrome-pad);
  box-sizing: border-box;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  justify-self: center;
}

.gapat-shell-root .glass-pill--segmented {
  position: relative;
}

.gapat-shell-root .glass-pill-slider {
  position: absolute;
  top: var(--gapat-chrome-pad);
  bottom: var(--gapat-chrome-pad);
  left: 0;
  width: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 4px 16px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.18s ease;
  pointer-events: none;
  z-index: 0;
}

.gapat-shell-root .glass-pill-slider.is-ready {
  opacity: 1;
}

.gapat-shell-root .glass-pill--segmented a,
.gapat-shell-root .glass-pill--segmented button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--gapat-chrome-font);
  font-family: var(--gapat-shell-font);
  line-height: 1.25;
  padding: var(--gapat-chrome-tab-pad-y) var(--gapat-chrome-tab-pad-x);
  border-radius: 9999px;
  transition: color 0.25s ease;
  white-space: nowrap;
  cursor: pointer;
}

.gapat-shell-root .glass-pill--segmented a:hover:not(.active),
.gapat-shell-root .glass-pill--segmented button:hover:not(.active) {
  color: #fff;
}

.gapat-shell-root .glass-pill--segmented a.active,
.gapat-shell-root .glass-pill--segmented button.active {
  color: #fff;
}

/* Account / login — match Vault user-info + logout pill */
.gapat-shell-root .user-info,
.gapat-shell-root .gapat-account-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--gapat-chrome-size);
  height: var(--gapat-chrome-size);
  box-sizing: border-box;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 9999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: var(--gapat-shell-font);
  font-size: 0.9rem;
  cursor: pointer;
}

.gapat-shell-root .user-avatar,
.gapat-shell-root .gapat-account-menu__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: #fff;
}

.gapat-shell-root .user-name,
.gapat-shell-root .gapat-account-menu__name {
  font-weight: 500;
  font-size: 0.9rem;
  color: #fff;
  font-family: var(--gapat-shell-font);
}

.gapat-shell-root .gapat-account-menu {
  position: relative;
}

.gapat-shell-root .gapat-account-menu__caret {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.55);
}

.gapat-shell-root .gapat-account-menu__dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 160px;
  padding: 0.375rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 20, 42, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 220;
  display: none;
}

.gapat-shell-root .gapat-account-menu.is-open .gapat-account-menu__dropdown {
  display: block;
}

.gapat-shell-root .gapat-account-menu__item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #fff;
  font-family: var(--gapat-shell-font);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.gapat-shell-root .gapat-account-menu__item:hover {
  background: rgba(255, 255, 255, 0.16);
}

.gapat-shell-root .gapat-login-link,
.gapat-shell-root .logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--gapat-chrome-size);
  height: var(--gapat-chrome-size);
  box-sizing: border-box;
  padding: 0 1.1rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  text-decoration: none;
  font-family: var(--gapat-shell-font);
  font-size: var(--gapat-chrome-font);
  font-weight: 500;
  line-height: 1.25;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.35);
  transition: background 0.25s, border-color 0.25s;
}

.gapat-shell-root .gapat-login-link:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Gate / waitlist */
.gapat-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 6rem 1.25rem 3rem;
  font-family: var(--gapat-shell-font);
  color: var(--gapat-shell-text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(168, 85, 247, 0.18), transparent 60%),
    var(--gapat-shell-bg);
}

.gapat-gate--inline {
  min-height: 40vh;
  background: transparent;
}

.gapat-waitlist {
  width: min(440px, 100%);
  padding: 2rem 1.75rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(236, 72, 153, 0.28);
  background: rgba(20, 20, 42, 0.85);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.gapat-waitlist__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gapat-shell-pink);
  font-weight: 600;
}

.gapat-waitlist__title {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gapat-waitlist__body {
  margin: 0 0 1.5rem;
  color: var(--gapat-shell-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.gapat-waitlist__email {
  display: block;
  margin: -0.5rem 0 1.25rem;
  font-size: 0.85rem;
  color: #c4b5fd;
}

.gapat-waitlist__btn {
  appearance: none;
  border: none;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
}

.gapat-waitlist__btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.gapat-waitlist__msg {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: #86efac;
}

.gapat-waitlist__msg.is-error {
  color: #fca5a5;
}

.gapat-coming-soon {
  width: min(520px, 100%);
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: rgba(20, 20, 42, 0.85);
  text-align: center;
}

.gapat-coming-soon h1 {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
}

.gapat-coming-soon p {
  margin: 0;
  color: var(--gapat-shell-muted);
}

/* Branded loader — vault combination dial unlocking (looping). */
.gapat-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
  min-height: 40vh;
  padding: 2rem 1.25rem;
  text-align: center;
  font-family: var(--gapat-shell-font);
  color: var(--gapat-shell-text);
}

.gapat-loader__door {
  position: relative;
  flex: 0 0 auto;
  box-sizing: border-box;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(160deg, #3a3a42 0%, #1a1a20 45%, #0e0e12 100%);
  box-shadow:
    0 0 0 8px #16161c,
    0 0 0 12px #2a2a32,
    0 0 0 16px #121218,
    0 20px 48px rgba(0, 0, 0, 0.55),
    inset 0 2px 8px rgba(255, 255, 255, 0.06);
}

.gapat-loader__bezel {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #1c1c22 0%, #121218 70%);
  box-shadow:
    inset 0 0 0 2px #3d3d48,
    inset 0 0 0 4px #22222a,
    inset 0 6px 16px rgba(0, 0, 0, 0.55);
}

.gapat-loader__dial {
  position: absolute;
  inset: 6%;
}

.gapat-loader__face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 40% 35%, #5a5a64 0%, #2e2e36 38%, #1a1a20 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    inset 0 -6px 16px rgba(0, 0, 0, 0.55);
  animation: gapat-vault-spin 2.6s cubic-bezier(0.45, 0.05, 0.2, 1) infinite;
}

.gapat-loader__tick {
  position: absolute;
  inset: 0;
  margin: 0;
  transform: rotate(var(--tick));
  transform-origin: 50% 50%;
  pointer-events: none;
}

.gapat-loader__tick::after {
  content: '';
  position: absolute;
  top: 4.5%;
  left: 50%;
  width: 1.5px;
  height: 6px;
  margin-left: -0.75px;
  background: rgba(230, 230, 235, 0.5);
  border-radius: 1px;
}

.gapat-loader__tick--major::after {
  top: 3.5%;
  width: 2.5px;
  height: 9px;
  margin-left: -1.25px;
  background: #f0e6c8;
  box-shadow: 0 0 4px rgba(245, 200, 66, 0.35);
}

.gapat-loader__num {
  position: absolute;
  top: 17%;
  left: 50%;
  transform: translateX(-50%) rotate(calc(-1 * var(--tick)));
  transform-origin: center center;
  font-family: 'Space Grotesk', 'Outfit', var(--gapat-shell-font), sans-serif;
  font-size: clamp(0.55rem, 7.5%, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(245, 240, 230, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  line-height: 1;
}

.gapat-loader__pointer {
  position: absolute;
  top: -2%;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 12px solid #f5c842;
  filter: drop-shadow(0 0 6px rgba(245, 200, 66, 0.55));
  z-index: 4;
}

.gapat-loader__knob {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #6a6a74, #2a2a32 55%, #141418 100%);
  border: 2px solid #4a4a54;
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.15),
    inset 0 -4px 10px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.45);
  animation: gapat-vault-spin-rev 2.6s cubic-bezier(0.4, 0.1, 0.15, 1) infinite;
}

.gapat-loader__knob img {
  width: 38%;
  height: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.gapat-loader__knob-grip {
  position: absolute;
  width: 18%;
  height: 10%;
  border-radius: 999px;
  background: linear-gradient(180deg, #8a8a94, #3a3a42);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.gapat-loader__knob-grip:nth-child(1) {
  top: 12%;
  left: 41%;
}

.gapat-loader__knob-grip:nth-child(2) {
  bottom: 18%;
  left: 14%;
  transform: rotate(55deg);
}

.gapat-loader__knob-grip:nth-child(3) {
  bottom: 18%;
  right: 14%;
  transform: rotate(-55deg);
}

.gapat-loader__handle {
  position: absolute;
  right: -5%;
  top: 42%;
  width: 12%;
  height: 14%;
  border-radius: 5px;
  background: linear-gradient(90deg, #2a2a32, #4a4a54 40%, #2e2e36);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.12),
    2px 4px 10px rgba(0, 0, 0, 0.45);
}

.gapat-loader__label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gapat-shell-muted);
  line-height: 1.5;
}

.gapat-loader--compact {
  min-height: 0;
  padding: 1.25rem 1rem;
  gap: 1rem;
}

.gapat-loader--compact .gapat-loader__label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

@keyframes gapat-vault-spin {
  0% { transform: rotate(0deg); }
  35% { transform: rotate(120deg); }
  55% { transform: rotate(95deg); }
  100% { transform: rotate(360deg); }
}

@keyframes gapat-vault-spin-rev {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(-90deg); }
  70% { transform: rotate(-70deg); }
  100% { transform: rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .gapat-loader__face,
  .gapat-loader__knob {
    animation-duration: 4.5s;
  }
}

@media (max-width: 820px) {
  .gapat-shell-root .top-bar {
    padding: 0.85rem 1rem;
    gap: 0.5rem;
  }

  .gapat-shell-root .glass-pill--segmented a,
  .gapat-shell-root .glass-pill--segmented button {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }

  .gapat-shell-root .gapat-account-menu__name,
  .gapat-shell-root .user-name {
    display: none;
  }
}
