/* ===================================================================
   TRAINQUANTS - GOOGLE AUTHENTICATION GATE DESIGN SYSTEM (auth-gate.css)
   Apple-Fintech Glassmorphism Google Sign-In Gate for Dev Space & IRL Sims
   =================================================================== */

.tq-auth-gate-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tq-auth-gate-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.tq-auth-gate-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(145deg, rgba(18, 22, 32, 0.96) 0%, rgba(10, 12, 18, 0.98) 100%);
  border: 1px solid rgba(66, 133, 244, 0.38);
  border-radius: 20px;
  padding: 36px 32px 30px 32px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.9), 0 0 40px rgba(66, 133, 244, 0.18);
  transform: translateY(24px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  color: #f1f5f9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.tq-auth-gate-backdrop.active .tq-auth-gate-card {
  transform: translateY(0) scale(1);
}

/* Multi-color Google Laser Border on Top */
.tq-auth-gate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4285F4 0%, #34A853 33%, #FBBC05 66%, #EA4335 100%);
  box-shadow: 0 0 16px rgba(66, 133, 244, 0.8);
}

/* Close Dismiss Button */
.tq-auth-gate-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.tq-auth-gate-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: scale(1.08);
}

/* Header & Brand Icon */
.tq-auth-gate-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.tq-auth-gate-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(66, 133, 244, 0.12);
  border: 1px solid rgba(66, 133, 244, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(66, 133, 244, 0.25);
}

.tq-auth-gate-icon-badge svg {
  width: 26px;
  height: 26px;
}

.tq-auth-gate-title-wrap {
  flex: 1;
}

.tq-auth-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 5px;
}

.tq-auth-gate-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.25;
}

/* Description */
.tq-auth-gate-desc {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 22px;
}

.tq-auth-gate-desc strong {
  color: #e2e8f0;
}

/* Benefits Bento Box */
.tq-auth-gate-benefits {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 24px;
}

.tq-auth-gate-benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
}

.tq-auth-gate-benefit-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 1px;
}

.tq-auth-gate-benefit-icon.blue {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.tq-auth-gate-benefit-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.tq-auth-gate-benefit-icon.gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Google Sign In CTA Button */
.btn-auth-gate-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1f2937;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-auth-gate-google:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(66, 133, 244, 0.3);
}

.btn-auth-gate-google:active {
  transform: translateY(0);
}

.btn-auth-gate-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Secondary Portal Option */
.tq-auth-gate-secondary {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.link-auth-gate-portal {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.link-auth-gate-portal:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.btn-auth-gate-dismiss {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  transition: color 0.2s;
}

.btn-auth-gate-dismiss:hover {
  color: #94a3b8;
}

/* In-Page Auth Alert Bar (Dev Space & Sandbox) */
.tq-auth-required-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(66, 133, 244, 0.14) 0%, rgba(20, 24, 33, 0.9) 100%);
  border: 1px solid rgba(66, 133, 244, 0.35);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #cbd5e1;
}

.tq-auth-required-banner .banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tq-auth-required-banner .banner-icon {
  color: #38bdf8;
  font-size: 14px;
}

.tq-auth-required-banner .btn-banner-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tq-auth-required-banner .btn-banner-login:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

/* Inline Google Account Prompt */
.tq-auth-gate-inline-prompt {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: rgba(66, 133, 244, 0.08);
  border: 1px solid rgba(66, 133, 244, 0.35);
  border-radius: 14px;
  text-align: left;
  animation: tqFadeSlideDown 0.25s ease-out;
}

/* Google Account Row Hover States */
.tq-google-account-row:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(138, 180, 248, 0.35) !important;
  transform: translateX(2px);
}

#btnGateToggleAdd:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* ===================================================================
   GOOGLE AUTHENTICATION SUCCESS POP-UP & REDIRECTION MODAL
   =================================================================== */

.tq-auth-success-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tq-auth-success-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.tq-auth-success-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(9, 14, 26, 0.99) 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 22px;
  padding: 34px 30px 28px 30px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.94), 0 0 50px rgba(16, 185, 129, 0.22);
  transform: translateY(20px) scale(0.96);
  transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  color: #f1f5f9;
  text-align: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.tq-auth-success-backdrop.active .tq-auth-success-card {
  transform: translateY(0) scale(1);
}

/* Multi-color Google Laser Border */
.tq-auth-success-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4285F4 0%, #34A853 33%, #FBBC05 66%, #EA4335 100%);
  box-shadow: 0 0 18px rgba(52, 168, 83, 0.8);
}

/* Emerald Checkmark Icon with Ripple Pulse */
.tq-success-icon-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tq-success-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.18);
  animation: tqPulseRing 1.8s infinite cubic-bezier(0.2, 0, 0.3, 1);
}

@keyframes tqPulseRing {
  0% { transform: scale(0.85); opacity: 0.9; }
  50% { transform: scale(1.18); opacity: 0.3; }
  100% { transform: scale(0.85); opacity: 0.9; }
}

.tq-success-icon {
  font-size: 52px;
  color: #10b981;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.65));
}

.tq-success-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 10px;
}

.tq-success-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.tq-success-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 20px 0;
  line-height: 1.45;
}

/* User Identity Bento Card */
.tq-success-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: left;
}

.tq-success-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.tq-success-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tq-success-user-info {
  flex: 1;
  min-width: 0;
}

.tq-success-user-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tq-success-user-email {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tq-success-badge-solver {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.32);
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Destination Banner */
.tq-success-destination-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  text-align: left;
}

.tq-dest-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.tq-dest-details {
  flex: 1;
  min-width: 0;
}

.tq-dest-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #38bdf8;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.tq-dest-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Smooth Redirect Progress Bar */
.tq-redirect-progress-wrap {
  margin-bottom: 22px;
}

.tq-redirect-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.tq-redirect-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 100%);
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.85);
  transition: width 0.05s linear;
}

.tq-redirect-progress-fill.animating {
  animation: tqFillBar 1.2s cubic-bezier(0.2, 0, 0.3, 1) forwards;
}

@keyframes tqFillBar {
  0% { width: 0%; }
  100% { width: 100%; }
}

.tq-redirect-countdown {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tq-redirect-countdown i {
  color: #38bdf8;
}

/* Action Buttons */
.tq-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-tq-launch-now {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-tq-launch-now:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.45);
}

.btn-tq-cancel-redirect {
  background: none;
  border: none;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 12px;
  transition: color 0.2s;
}

.btn-tq-cancel-redirect:hover {
  color: #94a3b8;
}

/* ===================================================================
   INSTITUTIONAL HIGH-CONTRAST LIGHT MODE — AUTH GATE
   =================================================================== */
html.light-mode .tq-auth-gate-card,
[data-theme="light"] .tq-auth-gate-card,
html.light-mode .tq-auth-success-card,
[data-theme="light"] .tq-auth-success-card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

html.light-mode .tq-auth-gate-title,
[data-theme="light"] .tq-auth-gate-title,
html.light-mode .tq-auth-success-title,
[data-theme="light"] .tq-auth-success-title {
  color: #09090b !important;
}

html.light-mode .tq-auth-gate-subtitle,
[data-theme="light"] .tq-auth-gate-subtitle,
html.light-mode .tq-auth-success-desc,
[data-theme="light"] .tq-auth-success-desc {
  color: #475569 !important;
}

html.light-mode .tq-auth-gate-close,
[data-theme="light"] .tq-auth-gate-close {
  color: #64748b !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

html.light-mode .tq-auth-gate-close:hover,
[data-theme="light"] .tq-auth-gate-close:hover {
  color: #09090b !important;
  background: rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .tq-auth-gate-benefit,
[data-theme="light"] .tq-auth-gate-benefit {
  color: #334155 !important;
}

html.light-mode .tq-auth-gate-footer,
[data-theme="light"] .tq-auth-gate-footer {
  color: #64748b !important;
}

html.light-mode .tq-auth-gate-toast,
[data-theme="light"] .tq-auth-gate-toast {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #09090b !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12) !important;
}



