/* Samnvay Auth Popup — clean compact dialog */

body.am-open {
  overflow: hidden !important;
}

#am-overlay {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  box-sizing: border-box;
  background:
    radial-gradient(50% 40% at 50% 0%, rgba(109, 60, 208, 0.22), transparent 55%),
    rgba(8, 6, 14, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#am-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Hide page avatar while modal is open */
body.am-open #sc-stage,
body.am-open #sc-debug {
  opacity: 0 !important;
  pointer-events: none !important;
}

.am-box {
  width: min(420px, 100%);
  max-height: min(90vh, 680px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  position: relative;
  color: #f3effb;
  font-family: var(--body, Inter, system-ui, sans-serif);
  background:
    radial-gradient(90% 50% at 50% -15%, rgba(109, 60, 208, 0.28), transparent 55%),
    linear-gradient(180deg, #1b1530 0%, #13101f 100%);
  border: 1px solid rgba(243, 239, 251, 0.14);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: scale(0.97) translateY(10px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
#am-overlay.open .am-box {
  transform: scale(1) translateY(0);
}

.am-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #c9c0e3;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.15s;
}
.am-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}
.am-close:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.am-head {
  flex: 0 0 auto;
  padding: 22px 22px 0;
  padding-right: 48px;
}

.am-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}
.am-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6d3cd0, #8a5ee0);
  color: #fff;
  box-shadow: 0 8px 18px rgba(109, 60, 208, 0.35);
  flex-shrink: 0;
}
.am-brand h2 {
  font-family: var(--display, "Space Grotesk", sans-serif);
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.am-brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(201, 192, 227, 0.7);
  font-weight: 500;
}

.am-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 22px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 116, 240, 0.45) transparent;
}
.am-scroll::-webkit-scrollbar {
  width: 6px;
}
.am-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.am-scroll::-webkit-scrollbar-thumb {
  background: rgba(155, 116, 240, 0.4);
  border-radius: 99px;
}
.am-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(155, 116, 240, 0.6);
}

.am-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}
.am-tab {
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: rgba(201, 192, 227, 0.75);
  background: transparent;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.am-tab.active {
  background: linear-gradient(135deg, #6d3cd0, #8a5ee0);
  color: #fff;
  box-shadow: 0 4px 14px rgba(109, 60, 208, 0.35);
}
.am-tab:hover:not(.active) {
  color: #f3effb;
}

.am-plan-note {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(109, 60, 208, 0.18);
  border: 1px solid rgba(138, 94, 224, 0.38);
  font-size: 12px;
  color: #e8e0f8;
  line-height: 1.4;
}
.am-plan-note.show { display: flex; }
.am-plan-note .am-plan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
  flex-shrink: 0;
}
.am-plan-copy { flex: 1; min-width: 0; }
.am-plan-note strong { font-weight: 700; color: #fff; }
.am-plan-clear {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #c9c0e3;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.am-plan-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.am-lead {
  margin: 0 0 12px;
  font-size: 13px;
  color: rgba(201, 192, 227, 0.82);
  line-height: 1.45;
}

.am-field {
  margin-bottom: 10px;
}
.am-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(201, 192, 227, 0.78);
  margin-bottom: 5px;
}
.am-field input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: #f3effb;
  padding: 0 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}
.am-field input:focus {
  border-color: rgba(138, 94, 224, 0.75);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(109, 60, 208, 0.2);
}
.am-field input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.am-error {
  display: none;
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.4;
}
.am-error.show { display: block; }

.am-form[hidden] { display: none !important; }

.am-actions {
  flex: 0 0 auto;
  padding: 4px 22px 16px;
  background: linear-gradient(180deg, transparent, rgba(19, 16, 31, 0.95) 28%);
}

.am-form .am-submit {
  margin-top: 6px;
}

.am-submit {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #6d3cd0, #8454e8);
  box-shadow: 0 10px 24px rgba(109, 60, 208, 0.4);
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s, opacity 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}
.am-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 28px rgba(109, 60, 208, 0.5);
}
.am-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}
.am-submit.signup {
  background: linear-gradient(135deg, #6d3cd0, #8454e8);
  color: #fff;
  box-shadow: 0 10px 24px rgba(109, 60, 208, 0.4);
}

.am-btn-spinner,
.am-busy-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  box-sizing: border-box;
  display: none;
  animation: am-spin 0.7s linear infinite;
  flex: 0 0 auto;
}
.am-submit.is-loading .am-btn-spinner {
  display: inline-block;
}
.am-busy-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-width: 2.5px;
}

@keyframes am-spin {
  to { transform: rotate(360deg); }
}

.am-busy-veil {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 18, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.am-busy-veil[hidden] {
  display: none !important;
}
.am-busy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(27, 21, 48, 0.96);
  border: 1px solid rgba(243, 239, 251, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: #f3effb;
  font-size: 13.5px;
  font-weight: 600;
}
.am-busy-card p {
  margin: 0;
}

#am-overlay.am-busy {
  cursor: progress;
}

.am-foot {
  margin-top: 2px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.01em;
}

@media (max-width: 480px) {
  #am-overlay { padding: 12px; align-items: flex-end; }
  .am-box {
    width: 100%;
    max-height: min(94vh, 720px);
    border-radius: 18px 18px 12px 12px;
  }
  .am-head { padding: 18px 16px 0; padding-right: 44px; }
  .am-scroll { padding: 0 16px 6px; }
  .am-actions { padding: 8px 16px 16px; }
}

@media (max-height: 720px) {
  .am-field { margin-bottom: 8px; }
  .am-field input { height: 40px; }
  .am-lead { margin-bottom: 10px; font-size: 12.5px; }
  .am-brand { margin-bottom: 12px; }
}
