/* Root tokens */
:root {
  --ml-radius: 0px;
  --ml-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  --ml-border: #e5e7eb;
  --ml-text: #0f172a;
  --ml-subtext: #64748b;
  --ml-bg: #ffffff;
  --ml-accent: rgba(1,62,131,1);
  --ml-accent-hover: rgba(1,62,131,.85);
  --ml-accent-weak: #fff;
  --ml-accent-weak-hover: #f4f4f4;
  --ml-danger: #b91c1c;
  --ml-danger-bg: #fee2e2;
  --ml-danger-border: #fecaca;
}

/* Fallback "Login" button (only shown if a menu trigger isn't found) */
.ml-fallback-login-button {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999999;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--ml-border);
  background: var(--ml-bg);
  color: var(--ml-text);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

/* Screen overlay / blur backdrop */
.ml-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999999; /* below fallback button, above site UI */
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  opacity: 0;
  transition: opacity .18s ease;
}
.ml-overlay[aria-hidden="false"] {
  display: block;
  opacity: 1;
}

/* Modal panel */
.ml-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(96vw, 400px);
  transform: translate(-50%, -48%) scale(.98);
  background: var(--ml-bg);
  border-radius: var(--ml-radius);
  box-shadow: var(--ml-shadow);
  padding: 22px 22px 18px;
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.ml-overlay[aria-hidden="false"] .ml-modal {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Header */
.ml-modal-header {
  margin-bottom: 10px;
}

#ml-login-title {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0 28px 22px 0;
}

#ml-login-title>img {
  height: 22px;
  margin: 0;
}

#ml-login-title>h2 {
  padding: 4px 0 0 0;
  font-size: 22px;
  line-height: 22px;
  margin: 0;
  color: var(--ml-text);
}

.ml-subtitle {
  margin: 0;
  color: var(--ml-subtext);
}

/* Close control */
.ml-close {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 34px;
  width: 34px;
  border: none;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ml-subtext);
  display: inline-grid;
  place-items: center;
}
.ml-close:hover { color: var(--ml-text); }

/* Form */
.ml-form { margin-top: 6px; }
.ml-field { margin-bottom: 14px; }
.ml-field label {
  display: block;
  font-weight: 400;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--ml-text);
}
.ml-field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius);
  transition: border-color .15s ease, box-shadow .15s ease;
  background: #fff;
}
.ml-field input:focus {
  border-color: var(--ml-accent);
}

/* Error box */
.ml-errors {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--ml-radius);
  color: var(--ml-danger);
  background: var(--ml-danger-bg);
  border: 1px solid var(--ml-danger-border);
}
.ml-errors[hidden] { display: none; }

/* Submit */
.ml-submit, .ml-btn-link {
  width: 100%;
  display: block;
  padding: .25rem !important;
  height: auto !important;
  text-align: center;
  border: solid 1px var(--ml-accent);
  border-radius: var(--ml-radius);
  font-weight: 400;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  background: var(--ml-accent);
  transition: .3s;
}

.ml-submit {
  margin-top: 1.5rem;
}

.ml-submit:hover {
  background: var(--ml-accent-hover);
}

.ml-btn-link {
  margin-top: .75rem;
  background: var(--ml-accent-weak);
  border: 1px solid var(--ml-accent);
  color: var(--ml-accent);
}

.ml-btn-link:hover {
  background: var(--ml-accent);
  color: #fff;
}

.ml-submit[disabled] {
  opacity: .75;
  cursor: not-allowed;
}

/* Spinner */
.ml-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  display: none;
  animation: ml-spin .8s linear infinite;
}
.ml-submit.is-loading .ml-spinner { display: inline-block; }
@keyframes ml-spin { to { transform: rotate(360deg); } }

.ml-help {
  margin: 10px 0 0;
  color: var(--ml-subtext);
  font-size: 14px;
  text-align: center;
}

/* Prevent background scroll when modal is open */
body.ml-lock-scroll { overflow: hidden; }

