/* ==========================================================================
   Q-TRACK LUXURY 3D GATEWAY & ROLE SELECTION (GURU TASMIK & GURU GANTI)
   Design System: Royal Islamic Emerald, Golden Glow & Glassmorphism 3D
   ========================================================================== */

/* 1. OVERLAY WRAPPER & ATMOSPHERE */
.gateway-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  min-height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.22) 0%, transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(245, 158, 11, 0.18) 0%, transparent 45%),
              radial-gradient(circle at 50% 50%, rgba(6, 78, 59, 0.35) 0%, transparent 70%),
              linear-gradient(135deg, #041a13 0%, #08281d 40%, #03150f 100%);
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: #f1f5f9;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.gateway-overlay.hidden {
  display: none !important;
}

/* Background Animated Blobs */
.gateway-bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.gateway-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: gatewayBlobPulse 10s ease-in-out infinite alternate;
}

.gateway-blob-1 {
  width: 380px;
  height: 380px;
  background: #10b981;
  top: -80px;
  left: -80px;
}

.gateway-blob-2 {
  width: 420px;
  height: 420px;
  background: #d97706;
  bottom: -100px;
  right: -100px;
  animation-delay: -5s;
}

.gateway-blob-3 {
  width: 300px;
  height: 300px;
  background: #059669;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.2;
}

@keyframes gatewayBlobPulse {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.15) translate(20px, -20px); }
}

/* 2. CONTAINER & LAYOUT */
.gateway-container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  width: 100%;
  margin: auto;
  animation: gatewayFadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gatewayFadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 3. TOPBAR HEADER */
.gateway-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 12px 20px;
  background: rgba(6, 44, 33, 0.65);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.gateway-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gateway-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gateway-brand-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gateway-brand-version {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 6px;
  color: #fbbf24;
  -webkit-text-fill-color: #fbbf24;
  letter-spacing: 0.5px;
}

.gateway-brand-sub {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1.2px;
  margin-top: 1px;
}

.gateway-top-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gateway-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 30px;
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 700;
}

.gateway-live-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
  animation: gatewayDotPulse 2s infinite;
}

@keyframes gatewayDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.gateway-btn-close {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gateway-btn-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  transform: translateY(-1px);
}

/* 4. HERO SECTION */
.gateway-intro {
  text-align: center;
  margin: 10px auto 26px;
  max-width: 680px;
}

.gateway-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(16, 185, 129, 0.18));
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 30px;
  color: #fde68a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gateway-intro h1 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
  margin: 14px 0 10px;
  background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 70%, #fde68a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.8px;
}

.gateway-intro p {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* 5. 3D ROLE CARDS GRID */
.gateway-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 920px;
  margin: 0 auto;
  perspective: 1200px;
}

.gateway-role-card {
  position: relative;
  min-height: 420px;
  background: linear-gradient(160deg, rgba(8, 47, 36, 0.85) 0%, rgba(3, 24, 18, 0.92) 100%);
  border: 2px solid rgba(52, 211, 153, 0.28);
  border-radius: 28px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(12px);
}

.gateway-role-card.substitute {
  background: linear-gradient(160deg, rgba(46, 26, 10, 0.85) 0%, rgba(24, 12, 4, 0.92) 100%);
  border-color: rgba(245, 158, 11, 0.32);
}

.gateway-role-card:hover,
.gateway-role-card:focus-visible {
  transform: translateY(-8px) scale(1.02);
  border-color: #34d399;
  box-shadow: 0 24px 50px rgba(16, 185, 129, 0.28), 0 0 30px rgba(52, 211, 153, 0.2);
}

.gateway-role-card.substitute:hover,
.gateway-role-card.substitute:focus-visible {
  border-color: #fbbf24;
  box-shadow: 0 24px 50px rgba(217, 119, 6, 0.28), 0 0 30px rgba(245, 158, 11, 0.2);
}

/* Card Glow Effect */
.gateway-card-glow {
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 60%);
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0.6;
}

.gateway-role-card.substitute .gateway-card-glow {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 60%);
}

.gateway-role-card:hover .gateway-card-glow {
  opacity: 1;
}

/* Top Section of Card */
.gateway-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.gateway-role-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 6px 12px;
  border-radius: 30px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
}

.gateway-role-card.substitute .gateway-role-label {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.gateway-role-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.gateway-role-card.substitute .gateway-role-icon {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* Hologram Art Center */
.gateway-art {
  height: 120px;
  position: relative;
  display: grid;
  place-items: center;
  margin: 16px 0 10px;
  z-index: 2;
}

.gateway-art-halo {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.35) 0%, rgba(5, 150, 105, 0.1) 70%, transparent 100%);
  animation: gatewayHaloFloat 4s ease-in-out infinite alternate;
}

.gateway-role-card.substitute .gateway-art-halo {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(217, 119, 6, 0.1) 70%, transparent 100%);
}

@keyframes gatewayHaloFloat {
  0% { transform: scale(0.9) translateY(0); }
  100% { transform: scale(1.15) translateY(-6px); }
}

.gateway-art-badge {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: linear-gradient(135deg, #059669 0%, #064e3b 100%);
  border: 2px solid rgba(167, 243, 208, 0.5);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 32px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 2px 2px rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gateway-role-card.substitute .gateway-art-badge {
  background: linear-gradient(135deg, #d97706 0%, #78350f 100%);
  border-color: rgba(253, 230, 138, 0.5);
}

.gateway-role-card:hover .gateway-art-badge {
  transform: scale(1.1) rotate(-3deg);
}

.gateway-role-card.substitute:hover .gateway-art-badge {
  transform: scale(1.1) rotate(3deg);
}

.gateway-spark {
  position: absolute;
  color: #6ee7b7;
  font-size: 16px;
  animation: gatewayTwinkle 2.5s ease-in-out infinite;
}

.gateway-role-card.substitute .gateway-spark {
  color: #fde68a;
}

.gateway-spark.s1 { top: 10px; left: 25%; animation-delay: 0s; }
.gateway-spark.s2 { bottom: 12px; right: 22%; animation-delay: 1s; }
.gateway-spark.s3 { top: 20px; right: 28%; animation-delay: 1.8s; }

@keyframes gatewayTwinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Card Copy & Features */
.gateway-copy {
  position: relative;
  z-index: 2;
  margin-bottom: 20px;
}

.gateway-copy h2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 22px;
  margin: 0 0 6px;
  color: #ffffff;
  letter-spacing: -0.4px;
}

.gateway-copy p {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
}

.gateway-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.gateway-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.gateway-features li i {
  color: #34d399;
  font-size: 13px;
}

.gateway-role-card.substitute .gateway-features li i {
  color: #fbbf24;
}

/* Card Action CTA */
.gateway-cta-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: all 0.25s ease;
}

.gateway-role-card.substitute .gateway-cta-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.gateway-arrow-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  font-size: 12px;
  transition: transform 0.25s ease;
}

.gateway-role-card:hover .gateway-arrow-circle {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.4);
}

/* 6. HELPER FOOTER BANNER */
.gateway-helper {
  max-width: 920px;
  margin: 22px auto 0;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  font-size: 12.5px;
  background: rgba(6, 44, 33, 0.55);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.gateway-helper-icon {
  color: #fbbf24;
  font-size: 18px;
  flex-shrink: 0;
}

/* 7. SUB-DIALOG CONFIRMATION POPUP */
.gateway-notice {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(2, 18, 13, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  place-items: center;
  padding: 20px;
}

.gateway-notice.open {
  display: grid;
}

.gateway-dialog {
  width: min(480px, 100%);
  padding: 32px 28px;
  border: 2px solid rgba(52, 211, 153, 0.4) !important;
  border-radius: 28px !important;
  background: linear-gradient(165deg, #073125 0%, #031c15 100%) !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 40px rgba(16, 185, 129, 0.2) !important;
  text-align: center;
  animation: gatewayPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'DM Sans', sans-serif;
  color: #f8fafc;
}

.gateway-dialog.sub {
  border-color: rgba(245, 158, 11, 0.45) !important;
  background: linear-gradient(165deg, #311c08 0%, #1a0e03 100%) !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 40px rgba(245, 158, 11, 0.2) !important;
}

.gateway-dialog-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
  display: grid;
  place-items: center;
  font-size: 26px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.gateway-dialog.sub .gateway-dialog-icon {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.gateway-dialog h3 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 23px;
  margin: 0 0 8px;
  color: #ffffff;
  letter-spacing: -0.4px;
}

.gateway-dialog p {
  color: #94a3b8;
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.gateway-dialog-select-box {
  text-align: left;
  margin-bottom: 22px;
}

.gateway-dialog-select-box label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  color: #6ee7b7;
}

.gateway-dialog.sub .gateway-dialog-select-box label {
  color: #fde68a;
}

.gateway-select-wrapper {
  position: relative;
}

.gateway-dialog-select-box select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(52, 211, 153, 0.3) !important;
  border-radius: 14px !important;
  background: #021e16 !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.gateway-dialog.sub .gateway-dialog-select-box select {
  border-color: rgba(245, 158, 11, 0.35) !important;
  background: #241405 !important;
}

.gateway-dialog-select-box select:focus {
  border-color: #34d399 !important;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

.gateway-dialog.sub .gateway-dialog-select-box select:focus {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.gateway-dialog-actions {
  display: flex;
  gap: 12px;
}

.gateway-dialog button {
  border: 0 !important;
  border-radius: 14px !important;
  padding: 13px 18px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gateway-dialog .btn-back {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  flex: 1;
}

.gateway-dialog .btn-back:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

.gateway-dialog .btn-continue {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  flex: 1.5;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4) !important;
}

.gateway-dialog .btn-continue:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.5) !important;
}

.gateway-dialog.sub .btn-continue {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4) !important;
}

.gateway-dialog.sub .btn-continue:hover {
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.5) !important;
}

@keyframes gatewayPop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 8. MOBILE & RESPONSIVE TWEAKS */
@media (max-width: 768px) {
  .gateway-overlay {
    padding: 16px 12px;
  }
  .gateway-topbar {
    padding: 10px 14px;
    margin-bottom: 18px;
  }
  .gateway-brand-title {
    font-size: 16px;
  }
  .gateway-brand-sub {
    font-size: 8.5px;
  }
  .gateway-status-pill {
    display: none; /* Hide status text on small mobile to save space */
  }
  .gateway-intro h1 {
    font-size: 24px;
    margin: 10px 0 8px;
  }
  .gateway-intro p {
    font-size: 12.5px;
  }
  .gateway-cards {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 460px;
  }
  .gateway-role-card {
    min-height: auto;
    padding: 22px 20px;
  }
  .gateway-art {
    height: 90px;
    margin: 10px 0 6px;
  }
  .gateway-art-badge {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }
  .gateway-copy h2 {
    font-size: 19px;
  }
  .gateway-features li {
    font-size: 11.5px;
  }
  .gateway-helper {
    font-size: 11.5px;
    padding: 10px 14px;
  }
}
