#mlwl-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#mlwl-overlay.mlwl-open {
  display: flex;
}

#mlwl-modal {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100svh - 2rem);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 600px) {
  #mlwl-overlay {
    padding: 0.5rem;
  }
  #mlwl-modal {
    min-height: 0 !important;
    max-height: calc(100vh - 1rem);
    max-height: calc(100svh - 1rem);
  }
}

#mlwl-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0;
}

#mlwl-close:hover {
  color: #000;
}

#mlwl-title {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

#mlwl-modal > p {
  margin: 0 0 1.25rem;
  color: #555;
  font-size: 0.95rem;
}

#mlwl-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  margin-top: 0.75rem;
}

#mlwl-form input[type="text"],
#mlwl-form input[type="email"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  box-sizing: border-box;
}

#mlwl-form input:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

#mlwl-submit {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

#mlwl-submit:hover:not(:disabled) {
  background: #005d8c;
}

#mlwl-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#mlwl-msg {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}

#mlwl-msg.mlwl-error {
  color: #c62828;
}

/* ── Result screen (success / error) ─────────────── */

#mlwl-result-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  padding: 1rem 0;
  gap: 1.25rem;
  animation: mlwl-fade-in 0.3s ease forwards;
}

@keyframes mlwl-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

#mlwl-result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  font-size: 2rem;
  line-height: 64px;
  text-align: center;
  flex-shrink: 0;
}

#mlwl-result-icon.mlwl-error-icon {
  background: #c62828;
}

#mlwl-result-text {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.5;
}

#mlwl-result-screen.mlwl-success #mlwl-result-text {
  color: #2e7d32;
}

#mlwl-result-screen.mlwl-error #mlwl-result-text {
  color: #c62828;
}
