/* SL Auth UI — Premium login/signup modal */

/* High-specificity reset — immune to page CSS conflicts */
.sl-auth-overlay, .sl-auth-overlay *,
.sl-gate-overlay, .sl-gate-overlay *{
  box-sizing: border-box;
}

.sl-auth-overlay{
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important;
  inset: 0 !important;
  background: rgba(8, 8, 14, 0.72) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 2147483000 !important;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  margin: 0 !important;
  animation: sl-auth-fade 0.18s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  color: #fff !important;
}
.sl-auth-overlay.open{ display: flex !important; }

/* Prevent page-level styles from leaking into the modal */
.sl-auth-overlay button,
.sl-auth-overlay input,
.sl-auth-overlay form,
.sl-auth-overlay label,
.sl-auth-overlay h1, .sl-auth-overlay h2, .sl-auth-overlay h3,
.sl-auth-overlay p, .sl-auth-overlay a{
  font-family: inherit !important;
  letter-spacing: normal !important;
}

@keyframes sl-auth-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sl-auth-modal{
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, #1a1b2e 0%, #15162b 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 28px 26px 24px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  position: relative;
  animation: sl-auth-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
@keyframes sl-auth-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sl-auth-close{
  position: absolute; top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.15s ease;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.sl-auth-close:hover{ background: rgba(212,175,55,0.25); border-color: rgba(212,175,55,0.5); color: #fff; transform: scale(1.05); }
.sl-auth-close:active{ transform: scale(0.95); }

.sl-auth-brand{
  text-align: center; margin-bottom: 18px;
}
.sl-auth-brand-logo{
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #d4af37 0%, #f4d35e 55%, #b8860b 100%);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.35),
              inset 0 1px 0 rgba(255,255,255,0.3);
  margin-bottom: 12px;
  color: #1a1b2e;
}
.sl-auth-title{
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  margin: 6px 0 4px;
}
.sl-auth-sub{
  color: #9ca0b4; font-size: 13px; margin: 0;
}

.sl-auth-tabs{
  display: flex; gap: 6px;
  background: rgba(255,255,255,0.04);
  padding: 4px; border-radius: 12px;
  margin: 18px 0 18px;
}
.sl-auth-tab{
  flex: 1;
  padding: 9px 12px;
  border: none; background: transparent;
  color: #9ca0b4;
  font-size: 13px; font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
}
.sl-auth-tab.active{
  background: rgba(255,255,255,0.08);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sl-auth-form{ display: none; }
.sl-auth-form.active{ display: block; }

/* ---------- OAuth buttons ---------- */
.sl-oauth-stack{
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px;
}
.sl-oauth-btn{
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
}
.sl-oauth-btn:disabled{ opacity: 0.6; cursor: not-allowed; }
.sl-oauth-btn .sl-oauth-icon{
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
}

.sl-oauth-google{
  background: #fff;
  color: #1f1f1f;
  border-color: #dadce0;
}
.sl-oauth-google:hover:not(:disabled){
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

.sl-oauth-apple{
  background: #000;
  color: #fff;
  border-color: #000;
}
.sl-oauth-apple:hover:not(.is-disabled){
  background: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.sl-oauth-apple.is-disabled{
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  border-color: rgba(255,255,255,0.1);
  cursor: not-allowed;
  position: relative;
}
.sl-oauth-apple.is-disabled::after{
  content: 'Soon';
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(255,215,0,0.15);
  color: #ffd700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,215,0,0.3);
}

.sl-auth-or{
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 14px;
  color: #6b6e82;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sl-auth-or::before, .sl-auth-or::after{
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.08);
}

.sl-auth-field{ margin-bottom: 12px; }
.sl-auth-label{
  display: block;
  font-size: 12px; font-weight: 600;
  color: #c4c7d8;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.sl-auth-input{
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.sl-auth-input:focus{
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}
.sl-auth-input::placeholder{ color: #6b6e82; }

.sl-auth-row{ display: flex; gap: 10px; }
.sl-auth-row > .sl-auth-field{ flex: 1; }

.sl-auth-submit{
  width: 100%;
  padding: 13px 16px;
  background: linear-gradient(135deg, #d4af37 0%, #f4d35e 55%, #b8860b 100%);
  border: none;
  border-radius: 10px;
  color: #1a1b2e;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3),
              inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.sl-auth-submit:hover:not(:disabled){
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(212, 175, 55, 0.45),
              inset 0 1px 0 rgba(255,255,255,0.3);
}
.sl-auth-submit:active{ transform: translateY(0); }
.sl-auth-submit:disabled{ opacity: 0.6; cursor: not-allowed; }

.sl-auth-error{
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}
.sl-auth-error.show{ display: block; }

.sl-auth-success{
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}
.sl-auth-success.show{ display: block; }

.sl-auth-foot{
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
  color: #9ca0b4;
}
.sl-auth-link{
  color: #f4d35e;
  background: none; border: none;
  cursor: pointer;
  font-size: inherit;
  font-weight: 600;
  padding: 0;
  text-decoration: none;
}
.sl-auth-link:hover{ text-decoration: underline; }

.sl-auth-divider{
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0;
  color: #6b6e82;
  font-size: 11px; letter-spacing: 0.06em;
}
.sl-auth-divider::before,
.sl-auth-divider::after{
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.08);
}

.sl-auth-hint{
  font-size: 11px; color: #8a8da0;
  margin-top: 4px;
}

.sl-auth-terms{
  font-size: 11px; color: #8a8da0;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
.sl-auth-terms a{ color: #f4d35e; text-decoration: none; }
.sl-auth-terms a:hover{ text-decoration: underline; }

/* Auth gate overlay for protected pages */
.sl-gate-overlay{
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important;
  inset: 0 !important;
  background: linear-gradient(180deg, rgba(10,10,20,0.85) 0%, rgba(10,10,20,0.92) 100%) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 2147482999 !important;
  display: flex !important;
  align-items: center; justify-content: center;
  padding: 24px;
  margin: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}
.sl-gate-card{
  max-width: 380px; width: 100%;
  text-align: center;
  color: #fff;
  padding: 32px 28px;
  background: rgba(20, 21, 36, 0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.sl-gate-icon{
  width: 60px; height: 60px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #d4af37 0%, #f4d35e 55%, #b8860b 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: #1a1b2e;
  box-shadow: 0 14px 32px rgba(212, 175, 55, 0.35),
              inset 0 1px 0 rgba(255,255,255,0.3);
}
.sl-gate-title{
  font-size: 20px; font-weight: 700; margin: 0 0 6px;
}
.sl-gate-msg{
  font-size: 13px; color: #9ca0b4; margin: 0 0 20px;
}
.sl-gate-btns{ display: flex; gap: 10px; flex-direction: column; }
.sl-gate-btn{
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.sl-gate-btn-primary{
  background: linear-gradient(135deg, #d4af37 0%, #f4d35e 55%, #b8860b 100%);
  color: #1a1b2e;
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.35),
              inset 0 1px 0 rgba(255,255,255,0.3);
}
.sl-gate-btn-secondary{
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Responsive */
@media (max-width: 480px){
  .sl-auth-modal{ padding: 24px 20px 20px; border-radius: 16px; }
  .sl-auth-title{ font-size: 20px; }
}

/* iOS safe-area */
@supports (padding: env(safe-area-inset-top)){
  .sl-auth-overlay{
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}