.mb-custom-modal {
  position: relative;
  z-index: 9999;
  display: none;
}

.mb-custom-modal.active {
  display: block;
}

.mb-custom-modal .mb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mb-custom-modal.active .mb-overlay {
  opacity: 1;
  pointer-events: auto;
}

.mb-custom-modal .mb-box {
  background: var(--mb-bg);
  color: var(--mb-text);
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.mb-custom-modal.active .mb-box {
  transform: translateY(0);
  opacity: 1;
}

.mb-custom-modal .mb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
}

.mb-custom-modal .mb-view {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mb-custom-modal .mb-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.mb-custom-modal .mb-view.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

:root,
html.light {
  --mb-bg: #ffffff;
  --mb-text: #222;
}

html.dark {
  --mb-bg: #1e1e1e;
  --mb-text: #eee;
}

.mb-custom-modal a[mb-custom-modal-view] {
  color: #007bff;
  cursor: pointer;
}

.mb-custom-modal a[mb-custom-modal-view]:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .mb-custom-modal .mb-box {
    padding: 24px;
    border-radius: 12px;
  }
}

.login-signup {
  display: flex;
  align-items: center;
}

.login-signup span {
  margin: 0 5px;
  color: #b5b5af;
  font-weight: bold;
}

.login-signup .social-x {
  margin-left: 20px;
}

.login-signup a span {
  transition: all .3s ease;
}

.login-signup a:hover span {
  color: #fff;
}

.mb-custom-modal .mb-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.mb-custom-modal .mb-field {
  display: flex;
  flex-direction: column;
}

.mb-custom-modal .mb-field input[type="text"],
.mb-custom-modal .mb-field input[type="email"],
.mb-custom-modal .mb-field input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--mb-border);
  background: var(--mb-input-bg);
  color: var(--mb-text);
  font-size: 16px;
  transition: all 0.25s ease;
}

.mb-custom-modal .mb-field input:focus {
  border-color: var(--mb-accent);
  box-shadow: 0 0 0 3px var(--mb-accent-light);
  outline: none;
}

.mb-custom-modal .mb-field.small {
  text-align: right;
  margin-top: -8px;
}

.mb-custom-modal .mb-btn {
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mb-custom-modal .mb-btn.primary {
  background: var(--mb-accent);
  color: #fff;
}

.mb-custom-modal .mb-btn.primary:hover {
  background: var(--mb-accent-hover);
}

.mb-custom-modal .mb-switch {
  margin-top: 28px;
  font-size: 15px;
  text-align: center;
}

.mb-custom-modal .mb-switch a {
  color: var(--mb-accent);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.mb-custom-modal h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--mb-header);
  text-align: center;
}

.mb-custom-modal p {
  font-size: 15px;
  line-height: 1.5;
}

:root,
html.light {
  --mb-bg: #fff;
  --mb-text: #202020;
  --mb-input-bg: #fafafa;
  --mb-border: #ddd;
  --mb-accent: #ff5722;
  --mb-accent-hover: #e64a19;
  --mb-accent-light: rgba(255, 87, 34, 0.2);
  --mb-muted: #777;
  --mb-header: #364855;
}

html.dark {
  --mb-bg: #1e1e1e;
  --mb-text: #f0f0f0;
  --mb-input-bg: #2b2b2b;
  --mb-border: #444;
  --mb-accent: #ff5722;
  --mb-accent-hover: #e64a19;
  --mb-accent-light: rgba(255, 87, 34, 0.3);
  --mb-muted: #aaa;
  --mb-header: #B9CBD9;
}

@media (max-width: 480px) {
  .mb-custom-modal .mb-box {
    padding: 24px;
  }

  .mb-custom-modal h2 {
    font-size: 24px;
  }
}

.mb-custom-modal .mb-field.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  line-height: 1.4;
}

.mb-custom-modal .mb-field.checkbox input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid var(--mb-border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  position: absolute;
  top: 9px;
  left: 0;
}

.mb-custom-modal .mb-field.checkbox input[type="checkbox"]:checked {
  border-color: var(--mb-accent);
  background: var(--mb-accent);
}

.mb-custom-modal .mb-field.checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mb-custom-modal .mb-field.checkbox label {
  font-size: 14px;
  color: var(--mb-muted);
  cursor: pointer;
  display: inline;
  vertical-align: middle;
  display: block;
  width: 100%;
  position: relative;
  padding-left: 35px;
}

.mb-custom-modal .mb-field.checkbox a {
  color: var(--mb-accent);
  font-weight: 600;
  text-decoration: none;
  display: inline;
}

.mb-custom-modal .mb-field.checkbox a:hover {
  color: var(--mb-accent-hover);
}

.mb-custom-modal a {
  text-decoration: none;
  transition: color 0.3s ease;
}

html.dark .mb-custom-modal a {
  color: #ffffff;
}

html.dark .mb-custom-modal a:hover {
  color: var(--mb-accent);
  text-decoration: none;
}

html.light .mb-custom-modal a {
  color: var(--mb-accent);
}

html.light .mb-custom-modal a:hover {
  color: var(--mb-accent-hover);
}


.mb-custom-modal .mb-notify {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.mb-custom-modal .mb-alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.3s ease forwards;
  margin-top: 10px;
}

.mb-custom-modal .mb-alert.success {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid #2ecc71;
  color: #2ecc71;
}

.mb-custom-modal .mb-alert.error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mb-custom-modal .mb-view-signup .mb-form {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mb-custom-modal .mb-view-signup .mb-form.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.mb-custom-modal .captcha-label {
  font-size: 14px;
  color: var(--mb-muted);
  margin-bottom: 6px;
  display: block;
}

.mb-custom-modal .captcha-img {
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  display: block;
  max-width: 50%;
}

.mb-custom-modal .captcha-img:hover {
  opacity: 0.85;
}