/* ==========================================================================
   DownPortal — Authentication System & Social Login (Modern Studio Design)
   Matches: Image 1 Specification, PMPro & Nextend Social Login
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Auth Container & Card Shell
   -------------------------------------------------------------------------- */
.sa-auth-wrap {
  width: 100%;
  max-width: 440px;
  margin: 36px auto 48px;
  padding: 0 16px;
  box-sizing: border-box;
}

.sa-auth-card {
  background: var(--ui-color-canvas, #ffffff);
  border: 1.5px solid var(--ui-color-border-soft, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  padding: 32px 28px;
  box-sizing: border-box;
  position: relative;
  transition: box-shadow 0.2s ease;
}

.sa-auth-card:hover {
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.07), 0 10px 12px -5px rgba(0, 0, 0, 0.03);
}

/* --------------------------------------------------------------------------
   2. Segmented Mode Switcher (Login / Signup)
   -------------------------------------------------------------------------- */
.sa-auth-tabs {
  display: flex;
  background: var(--ui-color-surface-muted, #f1f5f9);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 24px;
  gap: 4px;
}

.sa-auth-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--ui-color-text-muted, #64748b);
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  user-select: none;
}

.sa-auth-tab:hover {
  color: var(--ui-color-text-strong, #090d16);
}

.sa-auth-tab.is-active {
  background: var(--ui-color-canvas, #ffffff);
  color: var(--ui-color-primary, #2563eb);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* --------------------------------------------------------------------------
   3. Card Header Titles & Subtitles
   -------------------------------------------------------------------------- */
.sa-auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.sa-auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ui-color-text-strong, #090d16);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.25;
}

.sa-auth-subtitle {
  font-size: 13px;
  color: var(--ui-color-text-muted, #64748b);
  margin: 0;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   4. Form Groups & Modern Inputs
   -------------------------------------------------------------------------- */
.sa-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sa-auth-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.sa-auth-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ui-color-text-strong, #090d16);
  line-height: 1.2;
  margin: 0;
}

.sa-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.sa-auth-input {
  width: 100%;
  height: 44px;
  line-height: 22px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ui-color-text-strong, #090d16);
  background: var(--ui-color-canvas, #ffffff);
  border: 1.5px solid var(--ui-color-border, #cbd5e1);
  border-radius: 8px;
  padding: 10px 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.sa-auth-input::placeholder {
  color: #94a3b8;
  font-size: 13.5px;
}

.sa-auth-input:focus {
  border-color: var(--ui-color-primary, #2563eb);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14);
}

.sa-auth-input--with-btn {
  padding-right: 42px;
}

/* Password Toggle Icon Button */
.sa-auth-pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.sa-auth-pwd-toggle:hover {
  color: var(--ui-color-text-strong, #090d16);
}

.sa-auth-pwd-toggle svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   5. Form Meta Row (Remember & Forgot Links)
   -------------------------------------------------------------------------- */
.sa-auth-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 4px;
  font-size: 13px;
}

.sa-auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ui-color-text-muted, #475569);
  cursor: pointer;
  user-select: none;
}

.sa-auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  accent-color: var(--ui-color-primary, #2563eb);
  cursor: pointer;
}

.sa-auth-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-color-primary, #2563eb);
  text-decoration: none;
  transition: color 0.12s ease;
}

.sa-auth-link:hover {
  color: var(--ui-color-primary-hover, #1d4ed8);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   6. Primary Submit Button
   -------------------------------------------------------------------------- */
.sa-auth-btn {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.sa-auth-btn--primary {
  background: var(--ui-color-primary, #2563eb);
  color: #ffffff;
  border: none;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.sa-auth-btn--primary:hover {
  background: var(--ui-color-primary-hover, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sa-auth-btn--primary:active {
  transform: scale(0.99);
}

.sa-auth-btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   7. Prompt Switcher (Don't have an account? Signup)
   -------------------------------------------------------------------------- */
.sa-auth-switch-prompt {
  text-align: center;
  font-size: 13.5px;
  color: var(--ui-color-text-muted, #475569);
  margin: 6px 0 0;
}

.sa-auth-switch-prompt a {
  color: var(--ui-color-primary, #2563eb);
  font-weight: 700;
  text-decoration: none;
}

.sa-auth-switch-prompt a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   8. Subtle Divider (─── Or ───)
   -------------------------------------------------------------------------- */
.sa-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sa-auth-divider::before,
.sa-auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1.5px solid #e2e8f0;
}

.sa-auth-divider span {
  padding: 0 14px;
}

/* --------------------------------------------------------------------------
   9. Social Login Buttons (Facebook & Google)
   -------------------------------------------------------------------------- */
.sa-social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.sa-social-btn {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.sa-social-btn svg {
  flex-shrink: 0;
}

/* Facebook Button */
.sa-social-btn--facebook {
  background: #1877f2;
  color: #ffffff !important;
  border: 1px solid #1877f2;
}

.sa-social-btn--facebook:hover {
  background: #166fe5;
  border-color: #166fe5;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(24, 119, 242, 0.25);
}

/* Google Button */
.sa-social-btn--google {
  background: #ffffff;
  color: #1e293b !important;
  border: 1.5px solid var(--ui-color-border, #cbd5e1);
}

.sa-social-btn--google:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #090d16 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------------------------------
   10. Nextend Social Login (NSL) Compatibility Normalization
   -------------------------------------------------------------------------- */
div.nsl-container,
div.nsl-container .nsl-container-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

div.nsl-container .nsl-button {
  height: 44px !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
}

div.nsl-container .nsl-button-facebook {
  background: #1877f2 !important;
  border: 1px solid #1877f2 !important;
  color: #ffffff !important;
}

div.nsl-container .nsl-button-facebook:hover {
  background: #166fe5 !important;
  box-shadow: 0 4px 10px rgba(24, 119, 242, 0.25) !important;
}

div.nsl-container .nsl-button-google {
  background: #ffffff !important;
  border: 1.5px solid var(--ui-color-border, #cbd5e1) !important;
  color: #1e293b !important;
}

div.nsl-container .nsl-button-google:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #090d16 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}

div.nsl-container .nsl-button .nsl-button-svg-container {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* --------------------------------------------------------------------------
   11. Cloudflare Turnstile inside Auth Card
   -------------------------------------------------------------------------- */
.sa-auth-turnstile-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px 0 8px;
  min-height: 65px;
  width: 100%;
}

.sa-auth-turnstile-wrap .cf-turnstile {
  display: flex !important;
  justify-content: center !important;
}

/* --------------------------------------------------------------------------
   12. Notification & Alert Banners
   -------------------------------------------------------------------------- */
.sa-auth-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
  margin-bottom: 18px;
}

.sa-auth-alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.sa-auth-alert--error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #991b1b;
}

.sa-auth-alert--success {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #166534;
}

.sa-auth-alert--info {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1e40af;
}

/* --------------------------------------------------------------------------
   13. Logged-in Profile Overview Card
   -------------------------------------------------------------------------- */
.sa-auth-loggedin-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sa-auth-loggedin-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 14px;
}

.sa-auth-loggedin-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--ui-color-primary, #2563eb);
}

.sa-auth-loggedin-avatar.is-vip img {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.sa-auth-loggedin-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--ui-color-text-strong, #090d16);
  margin-bottom: 4px;
}

.sa-auth-loggedin-email {
  font-size: 13px;
  color: var(--ui-color-text-muted, #64748b);
  margin-bottom: 12px;
}

.sa-auth-loggedin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 22px;
}

.sa-auth-loggedin-badge.is-vip {
  background: #fffbeb;
  color: #b45309;
}

.sa-auth-loggedin-badge.is-uploader {
  background: #ecfdf5;
  color: #047857;
}

.sa-auth-loggedin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
}

.sa-auth-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: var(--ui-color-surface-subtle, #f8fafc);
  border: 1.5px solid var(--ui-color-border, #cbd5e1);
  border-radius: 6px;
  color: var(--ui-color-text-strong, #090d16);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.12s ease;
}

.sa-auth-action-btn:hover {
  background: var(--ui-color-primary, #2563eb);
  border-color: var(--ui-color-primary, #2563eb);
  color: #ffffff;
}

.sa-auth-action-btn.is-full {
  grid-column: span 2;
}

.sa-auth-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.12s ease;
}

.sa-auth-logout-btn:hover {
  background: #fef2f2;
  color: #b91c1c;
}

/* --------------------------------------------------------------------------
   14. Tab Views Display Control
   -------------------------------------------------------------------------- */
.sa-auth-panel {
  display: none;
}

.sa-auth-panel.is-active {
  display: block;
  animation: saAuthFadeIn 0.2s ease forwards;
}

@keyframes saAuthFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   15. Mobile & Responsive Tuning
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .sa-auth-card {
    padding: 24px 18px;
    border-radius: 10px;
  }

  .sa-auth-title {
    font-size: 20px;
  }

  .sa-auth-loggedin-actions {
    grid-template-columns: 1fr;
  }

  .sa-auth-action-btn.is-full {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   16. Clean Auth Canvas Layout Overrides
   -------------------------------------------------------------------------- */
.page-id-229 .page-header-strip,
.page-id-213 .page-header-strip,
.page-login .page-header-strip {
  display: none !important;
}

.page-id-229 .single-content-body,
.page-id-213 .single-content-body,
.page-login .single-content-body {
  padding: 0 !important;
  background: transparent !important;
}

