/* M4 LMS — Login / Register / Forgot-password popup.
   Uses the site's own brand tokens (set by the Style tab, see
   LMS_Portal::output_custom_styles) with sane fallbacks so it matches
   whatever colors/fonts/radii are already configured. */

.lms-auth-modal-open {
  overflow: hidden;
}

.lms-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lms-auth-modal[hidden] {
  display: none;
}

.lms-auth-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 20, 24, 0.55);
}

.lms-auth-modal__panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--lms-radius-card, 12px);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  font-family: var(--lms-font-body, inherit);
}

.lms-auth-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  border-radius: 999px;
}
.lms-auth-modal__close:hover {
  background: #f3f4f6;
}

.lms-auth-modal__title {
  font-family: var(--lms-font-heading, inherit);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  padding-right: 1.5rem;
}

.lms-auth-modal__notice {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.lms-auth-modal__notice--error {
  background: #fef2f2;
  color: #b91c1c;
}
.lms-auth-modal__notice--success {
  background: #ecfdf3;
  color: #067647;
}

/* Self-contained button baseline for the CT link and the [lms_login_button]
   trigger — this stylesheet loads site-wide (any page can open the modal),
   so it can't depend on lms-frontend.css/lms-portal.css's .lms-btn, which
   only load on course/portal pages. Those classes still win on pages where
   both stylesheets happen to load, since they come later in enqueue order. */
.lms-auth-modal__ct-btn,
[data-lms-open-auth] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: var(--lms-radius-btn, 6px);
  background: var(--lms-primary, #2271b1);
  color: #fff;
  font-family: var(--lms-font-body, inherit);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}
.lms-auth-modal__ct-btn:hover,
[data-lms-open-auth]:hover {
  background: var(--lms-primary-dark, #135e96);
  color: #fff;
}

.lms-auth-modal__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #9ca3af;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.1rem 0;
}
.lms-auth-modal__divider::before,
.lms-auth-modal__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.lms-auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.lms-auth-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.lms-auth-modal__form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

.lms-auth-modal__form input[type="text"],
.lms-auth-modal__form input[type="email"],
.lms-auth-modal__form input[type="password"] {
  font-size: 0.95rem;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
  width: 100%;
}
.lms-auth-modal__form input:focus {
  outline: 2px solid var(--lms-primary, #2271b1);
  outline-offset: 1px;
  border-color: var(--lms-primary, #2271b1);
}

.lms-auth-modal__strength {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  width: fit-content;
}
.lms-auth-modal__strength--short,
.lms-auth-modal__strength--bad {
  background: #fef2f2;
  color: #b91c1c;
}
.lms-auth-modal__strength--good {
  background: #fffbeb;
  color: #92400e;
}
.lms-auth-modal__strength--strong {
  background: #ecfdf3;
  color: #067647;
}

.lms-auth-modal__consent {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.5rem !important;
  font-weight: 400 !important;
  font-size: 0.82rem !important;
  color: #4b5563 !important;
}
.lms-auth-modal__consent input {
  margin-top: 0.2rem;
}
.lms-auth-modal__consent a {
  color: var(--lms-primary, #2271b1);
}

.lms-auth-modal__form button[type="submit"] {
  border: none;
  border-radius: var(--lms-radius-btn, 6px);
  background: var(--lms-primary, #2271b1);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
}
.lms-auth-modal__form button[type="submit"]:hover {
  background: var(--lms-primary-dark, #135e96);
}
.lms-auth-modal__form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: default;
}

.lms-auth-modal__switch {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
  text-align: center;
}
.lms-auth-modal__switch button {
  border: none;
  background: none;
  color: var(--lms-primary, #2271b1);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
