/* ShwePlay Auth, Quick-Login Modal & Error Mobile/Theme Remediation */
.shweplay-auth .login-page-content,
.dark-mode .login-page-content,
.light-mode .login-page-content {
  background: transparent !important;
  position: relative !important;
  right: auto !important;
  top: auto !important;
  width: 100% !important;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)) !important;
  justify-content: flex-start !important;
}

.shweplay-auth .sp-auth-utility {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: 1050px !important;
  margin: 0 auto 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  flex-wrap: nowrap;
}

.sp-auth-back-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(13, 17, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9 !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.sp-auth-back-home:hover { border-color: rgba(245, 179, 1, 0.5); color: #ffd65b !important; }

.sp-auth-utility-end { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

.shweplay-auth .sp-auth-utility #lightmode,
.shweplay-auth .sp-auth-utility #darkmode,
.shweplay-auth .sp-auth-utility .sp-auth-theme {
  position: relative !important;
  inset: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(13, 17, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffd65b;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sp-auth-card .form-control,
.sp-auth-modal .form-control,
.sp-input {
  font-size: 16px !important;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease !important;
}

.sp-auth-pwd-wrap { position: relative; display: flex; align-items: center; }
.sp-auth-pwd-wrap .form-control { padding-right: 48px !important; }
.sp-auth-pwd-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.sp-auth-pwd-toggle:hover, .sp-auth-pwd-toggle:focus-visible { color: #ffd65b; outline: none; }

.sp-auth-card .remember-me {
  height: auto !important;
  min-height: 44px;
  line-height: 1.55;
  float: none !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin: 0;
  text-align: left;
  cursor: pointer;
}
.sp-auth-card .remember-me input[type="checkbox"] { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; }

.sp-auth-meta { flex-wrap: wrap !important; gap: 8px 12px !important; }
.sp-auth-meta > a { display: inline-flex; align-items: center; min-height: 44px; }

.sp-auth-single-experience { max-width: 520px !important; min-height: 0 !important; grid-template-columns: 1fr !important; margin: auto; }
.sp-auth-single-card {
  background: linear-gradient(165deg, rgba(17, 23, 35, 0.95), rgba(9, 13, 20, 0.98)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0 0 24px 24px !important;
}
.sp-auth-copy { color: #cbd5e1; font-size: 0.95rem; line-height: 1.7; margin: 0 0 22px; text-align: center; overflow-wrap: anywhere; word-break: break-word; }
.sp-auth-cta { min-height: 48px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; width: 100%; }
.sp-auth-back-row { margin: 16px 0 0; text-align: center; }
.sp-auth-back-row a, .sp-auth-sublink a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; font-size: 0.88rem; font-weight: 700; }

.sp-auth-alert { display: flex; align-items: flex-start; gap: 10px; border-radius: 12px; padding: 12px 15px; margin-bottom: 16px; font-size: 0.85rem; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.sp-auth-alert.is-danger { background: rgba(235, 87, 87, 0.15); border: 1px solid rgba(235, 87, 87, 0.42); color: #fca5a5; }
.sp-auth-alert.is-success { background: rgba(46, 204, 113, 0.15); border: 1px solid rgba(46, 204, 113, 0.42); color: #6ee7b7; }
.sp-auth-trust-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 14px; margin-top: 18px; font-size: 11px; color: #8b97ab; letter-spacing: 0.04em; }

/* Guest Quick-Login Modal */
.sp-auth-modal-shell { align-items: center; justify-content: center; padding: 16px !important; }
.sp-auth-modal-shell[style*="block"], .sp-auth-modal-shell[style*="flex"], .sp-auth-modal-shell.is-open { display: flex !important; }
.sp-auth-modal {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  margin: auto !important;
  width: 100% !important;
  max-width: 440px !important;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
}
.sp-auth-close { width: 44px !important; height: 44px !important; right: 12px !important; top: 12px !important; }
.sp-auth-row { flex-wrap: wrap !important; gap: 8px 12px !important; }
.sp-auth-check, .sp-auth-row > a { min-height: 44px; display: inline-flex !important; align-items: center !important; }

/* Light Mode Contrast */
.light-mode .login-page-bg-blur { background: radial-gradient(circle at 20% 10%, rgba(245, 179, 1, 0.16), transparent 36%), rgba(241, 245, 249, 0.92) !important; }
.light-mode .sp-auth-back-home, .light-mode.shweplay-auth .sp-auth-utility .sp-auth-theme { background: #ffffff !important; border-color: rgba(15, 23, 42, 0.14) !important; color: #0f172a !important; }
.light-mode .sp-auth-brand { background: rgba(255, 255, 255, 0.95) !important; border-color: rgba(15, 23, 42, 0.1) !important; color: #0f172a !important; }
.light-mode .sp-auth-card, .light-mode .sp-auth-login-card, .light-mode .sp-auth-register-card, .light-mode .sp-auth-single-card, .light-mode .sp-auth-modal, .light-mode .sp-error-card { background: #ffffff !important; border-color: rgba(15, 23, 42, 0.12) !important; color: #0f172a !important; box-shadow: 0 22px 56px rgba(15, 23, 42, 0.12) !important; }
.light-mode .sp-auth-heading h1, .light-mode .sp-auth-modal .sp-auth-heading h2, .light-mode .sp-auth-field label { color: #0f172a !important; }
.light-mode .sp-auth-heading p, .light-mode .sp-auth-copy, .light-mode .sp-auth-trust-footer { color: #475569 !important; border-color: rgba(15, 23, 42, 0.1) !important; }
.light-mode .sp-auth-heading .eyebrow, .light-mode .sp-auth-eyebrow, .light-mode .sp-auth-meta a, .light-mode .sp-auth-row a, .light-mode .sp-auth-switch a, .light-mode .sp-auth-card a:not(.btn) { color: #92400e !important; }
.light-mode .sp-auth-card .form-control, .light-mode .sp-auth-modal .form-control { background: #f8fafc !important; border-color: rgba(15, 23, 42, 0.18) !important; color: #0f172a !important; }
.light-mode .sp-auth-pwd-toggle { color: #475569; }
.light-mode .sp-auth-close { background: #f1f5f9 !important; border-color: rgba(15, 23, 42, 0.16) !important; color: #0f172a !important; }
.light-mode .sp-auth-alert.is-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.light-mode .sp-auth-alert.is-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

.sp-locale-mm.shweplay-auth, .sp-locale-mm .sp-auth-modal { font-family: "Noto Sans Myanmar", "Padauk", "Pyidaungsu", "Segoe UI", sans-serif !important; line-height: 1.65; }
.sp-locale-mm .sp-auth-trust-footer { text-transform: none; letter-spacing: 0; line-height: 1.55; }

@media (max-width: 720px) {
  .shweplay-auth .sp-auth-utility { max-width: 760px !important; }
  .sp-auth-single-card { border-radius: 22px !important; }
}
@media (max-width: 575px) {
  .shweplay-auth .login-page-content { padding: max(12px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom)) !important; }
  .shweplay-auth .alert-home { left: 12px !important; right: 12px !important; top: 12px !important; max-width: calc(100vw - 24px) !important; width: auto !important; }
  .sp-auth-back-home { padding: 0 11px; font-size: 0.78rem; }
  .sp-auth-modal { padding: 24px 16px 20px !important; border-radius: 20px !important; }
  .sp-error-experience { min-height: auto !important; margin: auto 0; }
  .sp-error-orbit { width: 120px !important; height: 120px !important; margin-bottom: 18px !important; }
  .sp-error-orbit span { font-size: 2.8rem !important; }
  .sp-error-home { width: 100% !important; min-width: 0 !important; min-height: 48px !important; }
}
