/* =============================================
   SD MERCHANT LOGIN — Premium Partner Portal Login
   ============================================= */

*,*::before,*::after { box-sizing: border-box; }

html {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #fff;
}
a:hover { text-decoration: none; }
label span.required { display: none; }

/* --- Main Layout: Split Panel --- */
.sd-mlogin {
  display: flex;
  min-height: 100vh;
}

/* Left Panel */
.sd-mlogin__left {
  flex: 0 0 45%;
  position: relative;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sd-mlogin__left-overlay {
  position: absolute;
  inset: 0;
  background: url("../images/login-banner2@2x.jpg") center/cover no-repeat;
  opacity: 0.06;
  pointer-events: none;
}
.sd-mlogin__left::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,107,0,0.08);
  pointer-events: none;
}
.sd-mlogin__left::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,107,0,0.05);
  pointer-events: none;
}
.sd-mlogin__left-content {
  position: relative;
  z-index: 1;
  padding: 60px 48px;
  max-width: 480px;
  color: #fff;
}
.sd-mlogin__brand {
  margin-bottom: 40px;
}
.sd-mlogin__logo {
  max-width: 200px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sd-mlogin__left-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 14px;
  color: #fff;
}
.sd-mlogin__left-sub {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,0.7);
  margin: 0 0 40px;
}
.sd-mlogin__left-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sd-mlogin__feature {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}
.sd-mlogin__feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,107,0,0.15);
  border: 1px solid rgba(255,107,0,0.2);
  border-radius: 10px;
  flex-shrink: 0;
  font-size: 18px;
  color: #FF8C3A;
}

/* Right Panel */
.sd-mlogin__right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #fff;
  position: relative;
}
.sd-mlogin__right-inner {
  width: 100%;
  max-width: 400px;
}

/* Theme toggle */
.sd-mlogin__theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.sd-mlogin__theme-toggle:hover {
  background: #f0f0f0;
  border-color: #ccc;
}

/* Mobile logo (hidden on desktop) */
.sd-mlogin__mobile-logo {
  display: none;
  text-align: center;
  margin-bottom: 32px;
}
.sd-mlogin__mobile-logo img {
  max-width: 180px;
  height: auto;
  max-height: 44px;
  object-fit: contain;
}

/* --- Form Header --- */
.sd-mlogin__header {
  margin-bottom: 28px;
}
.sd-mlogin__title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
}
.sd-mlogin__sub {
  font-size: 14px;
  color: #888;
  margin: 0;
}

/* --- Form Fields --- */
.sd-mlogin__form {
  display: flex;
  flex-direction: column;
}
.sd-mlogin__field {
  margin-bottom: 20px;
}
.sd-mlogin__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}
.sd-mlogin__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sd-mlogin__input-icon {
  position: absolute;
  left: 14px;
  color: #aaa;
  font-size: 18px;
  z-index: 1;
  pointer-events: none;
}
.sd-mlogin__input {
  width: 100%;
  height: 50px;
  padding: 0 14px 0 44px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a1a;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}
.sd-mlogin__input:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.1);
  background: #fff;
}
.sd-mlogin__input::placeholder {
  color: #bbb;
}
.sd-mlogin__input-wrap--pw .sd-mlogin__input {
  padding-right: 48px;
}

/* Password toggle */
.sd-mlogin__pw-toggle {
  position: absolute;
  right: 4px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s;
}
.sd-mlogin__pw-toggle:hover {
  color: #555;
}

/* Error */
.sd-mlogin__error {
  display: block;
  font-size: 12px;
  color: #dc3545;
  margin-top: 5px;
}

/* Options row */
.sd-mlogin__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* Remember me */
.sd-mlogin__remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  margin: 0;
  position: relative;
}
.sd-mlogin__checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.sd-mlogin__remember-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid #ccc;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sd-mlogin__remember-mark::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #FF6B00;
  transform: scale(0);
  transition: transform 0.15s;
}
.sd-mlogin__checkbox:checked ~ .sd-mlogin__remember-mark {
  border-color: #FF6B00;
  background: rgba(255,107,0,0.06);
}
.sd-mlogin__checkbox:checked ~ .sd-mlogin__remember-mark::after {
  transform: scale(1);
}
.sd-mlogin__remember-text {
  font-weight: 500;
}

/* Forgot link */
.sd-mlogin__forgot {
  font-size: 13px;
  color: #FF6B00;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.sd-mlogin__forgot:hover {
  color: #e55f00;
  text-decoration: underline;
}

/* Submit button */
.sd-mlogin__btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  background: #FF6B00;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.sd-mlogin__btn:hover {
  background: #e55f00;
  box-shadow: 0 4px 16px rgba(255,107,0,0.3);
}

/* Demo card */
.sd-mlogin__demo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 14px 16px;
  background: #FFF7ED;
  border: 1px solid #FFE0C0;
  border-radius: 12px;
}
.sd-mlogin__demo-info p {
  margin: 0;
  font-size: 13px;
  color: #555;
}
.sd-mlogin__demo-copy {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FF6B00;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  transition: background 0.2s;
}
.sd-mlogin__demo-copy:hover {
  background: #e55f00;
  color: #fff;
}

/* App store */
.sd-mlogin__apps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.sd-mlogin__apps img {
  max-width: 120px;
  height: auto;
}

/* Alerts */
.sd-mlogin__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.sd-mlogin__alert i {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.sd-mlogin__alert--ok {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.sd-mlogin__alert--err {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Back link */
.sd-mlogin__back-link {
  text-align: center;
  margin-top: 20px;
}
.sd-mlogin__back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #FF6B00;
  text-decoration: none;
  transition: color 0.2s;
}
.sd-mlogin__back-link a:hover {
  color: #e55f00;
}
.sd-mlogin__back-link a i {
  font-size: 16px;
}

/* Success card */
.sd-mlogin__success-card {
  text-align: center;
}
.sd-mlogin__success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f0fdf4;
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
}

/* Copyright */
.sd-mlogin__copy {
  text-align: center;
  font-size: 12px;
  color: #bbb;
  margin: 28px 0 0;
}

/* --- Responsive --- */
@media (max-width: 991px) {
  .sd-mlogin {
    flex-direction: column;
  }
  .sd-mlogin__left {
    flex: none;
    min-height: 220px;
    padding: 0;
  }
  .sd-mlogin__left-content {
    padding: 40px 28px;
  }
  .sd-mlogin__left-title {
    font-size: 24px;
  }
  .sd-mlogin__left-sub {
    font-size: 14px;
    margin-bottom: 20px;
  }
  .sd-mlogin__left-features {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
  .sd-mlogin__feature {
    font-size: 13px;
  }
  .sd-mlogin__feature-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 8px;
  }
  .sd-mlogin__right {
    padding: 32px 20px 40px;
  }
}

@media (max-width: 767px) {
  .sd-mlogin__left {
    display: none;
  }
  .sd-mlogin__mobile-logo {
    display: block;
  }
  .sd-mlogin__right {
    min-height: 100vh;
  }
  .sd-mlogin__title {
    font-size: 22px;
  }
  .sd-mlogin__input {
    height: 46px;
    font-size: 14px;
  }
  .sd-mlogin__btn {
    height: 46px;
    font-size: 15px;
  }
}

/* =============================================
   DARK MODE
   ============================================= */
html[data-theme="dark"] body {
  background: #121212;
}
html[data-theme="dark"] .sd-mlogin__left {
  background: linear-gradient(160deg, #0d0d1a 0%, #111827 50%, #0a1628 100%);
}
html[data-theme="dark"] .sd-mlogin__left-sub {
  color: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .sd-mlogin__feature {
  color: rgba(255,255,255,0.75);
}
html[data-theme="dark"] .sd-mlogin__feature-icon {
  background: rgba(255,107,0,0.12);
  border-color: rgba(255,107,0,0.15);
}
html[data-theme="dark"] .sd-mlogin__right {
  background: #1a1a1a;
}
html[data-theme="dark"] .sd-mlogin__theme-toggle {
  background: #252525;
  border-color: #3a3a3a;
  color: #ccc;
}
html[data-theme="dark"] .sd-mlogin__theme-toggle:hover {
  background: #2a2a2a;
  border-color: #555;
}
html[data-theme="dark"] .sd-mlogin__title {
  color: #f0f0f0;
}
html[data-theme="dark"] .sd-mlogin__sub {
  color: #777;
}
html[data-theme="dark"] .sd-mlogin__label {
  color: #bbb;
}
html[data-theme="dark"] .sd-mlogin__input {
  background: #252525;
  border-color: #3a3a3a;
  color: #e0e0e0;
}
html[data-theme="dark"] .sd-mlogin__input:focus {
  background: #2a2a2a;
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.15);
}
html[data-theme="dark"] .sd-mlogin__input::placeholder {
  color: #666;
}
html[data-theme="dark"] .sd-mlogin__input-icon {
  color: #666;
}
html[data-theme="dark"] .sd-mlogin__pw-toggle {
  color: #666;
}
html[data-theme="dark"] .sd-mlogin__pw-toggle:hover {
  color: #aaa;
}
html[data-theme="dark"] .sd-mlogin__error {
  color: #f87171;
}
html[data-theme="dark"] .sd-mlogin__remember {
  color: #bbb;
}
html[data-theme="dark"] .sd-mlogin__remember-mark {
  background: #252525;
  border-color: #555;
}
html[data-theme="dark"] .sd-mlogin__checkbox:checked ~ .sd-mlogin__remember-mark {
  background: rgba(255,107,0,0.1);
  border-color: #FF6B00;
}
html[data-theme="dark"] .sd-mlogin__btn:hover {
  box-shadow: 0 4px 16px rgba(255,107,0,0.25);
}
html[data-theme="dark"] .sd-mlogin__demo {
  background: rgba(255,107,0,0.08);
  border-color: rgba(255,107,0,0.2);
}
html[data-theme="dark"] .sd-mlogin__demo-info p {
  color: #ccc;
}
html[data-theme="dark"] .sd-mlogin__copy {
  color: #555;
}
html[data-theme="dark"] .sd-mlogin__mobile-logo img {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .sd-mlogin__alert--ok {
  background: rgba(22,163,74,0.1);
  color: #4ade80;
  border-color: rgba(22,163,74,0.2);
}
html[data-theme="dark"] .sd-mlogin__alert--err {
  background: rgba(220,38,38,0.1);
  color: #f87171;
  border-color: rgba(220,38,38,0.2);
}
html[data-theme="dark"] .sd-mlogin__success-icon {
  background: rgba(34,197,94,0.1);
}
html[data-theme="dark"] .sd-mlogin__logo {
  filter: brightness(0) invert(1);
}
html[data-theme="dark"] .sd-mlogin__forgot {
  color: #FF8C3A;
}
html[data-theme="dark"] .sd-mlogin__forgot:hover {
  color: #FFa555;
}
html[data-theme="dark"] .sd-mlogin__back-link a {
  color: #FF8C3A;
}
html[data-theme="dark"] .sd-mlogin__back-link a:hover {
  color: #FFa555;
}

/* =============================================
   LEGACY CLASSES — Admin login form compatibility
   These styles support the old admin loginForm.php 
   and admin forgotpassword views that still use 
   legacy CSS classes (form-control-text, btn-green, etc.)
   ============================================= */
p.dim { color: #a3a3a3; }
label.dim, a.dim { color: #404445; font-size: 12px; }
a.underline { text-decoration: underline; }
h6, h5 { font-weight: 600; }
h6 { text-align: center; }

form .errorMessage {
  text-align: initial;
  font-size: 12px;
  color: #dc3545;
  padding: 5px 0 0 0;
}
.btn-green {
  background: #FF6B00;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border-radius: .45rem;
  padding: 12px;
}
.btn-green:focus, .btn-green:hover { color: #fff !important; }
.btn-full { width: 100%; }
.btn-green.normal { padding: .375rem .75rem; }

.form-control-text {
  font-size: 15px;
  font-weight: 500;
  border-radius: .45rem;
  padding-left: 15px !important;
  background: #f6f7f9;
  border: none;
  min-height: 55px;
}
.form-label-group > label { font-size: 15px; font-weight: 500; }

.custom-checkbox { margin-left: 10px; }
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
  background-color: #FF6B00 !important;
}
.custom-checkbox .custom-control-input:checked:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(255, 107, 0, 0.25);
}
.custom-checkbox .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 0, 0, 0.25);
}
.custom-checkbox .custom-control-input:active ~ .custom-control-label::before {
  background-color: #FFE0C0;
}

/* Legacy dark mode for admin form */
html[data-theme="dark"] .form-control-text {
  background: #252525;
  border-color: #3a3a3a;
  color: #e0e0e0;
}
html[data-theme="dark"] .form-control-text:focus {
  background: #2a2a2a;
  border-color: #FF6B00;
}
html[data-theme="dark"] h6 { color: #f0f0f0; }
html[data-theme="dark"] p.dim { color: #777; }
html[data-theme="dark"] label.dim, html[data-theme="dark"] a.dim { color: #bbb; }
html[data-theme="dark"] form .errorMessage { color: #f87171; }
html[data-theme="dark"] .card.border { background: #252525; border-color: #3a3a3a !important; }
html[data-theme="dark"] .card-body p { color: #ccc; }
