/* Auth modal — same-page login + register (Classic two-column). */

.auth-modal[hidden] {
  display: none !important;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.auth-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 42, 38, 0.45);
  border: 0;
  cursor: pointer;
}

.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 52rem);
  max-height: min(92vh, 40rem);
  overflow: auto;
  background: var(--white, #f7f1e4);
  border: 1px solid var(--border, rgba(44, 42, 38, 0.1));
  border-radius: var(--radius, 12px);
  box-shadow: 0 20px 48px rgba(44, 42, 38, 0.16);
  padding: 1.5rem 1.5rem 1.75rem;
  color: var(--on-surface, var(--text, #2c2a26));
}

.auth-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.auth-modal__header h2 {
  font-family: var(--font-display, Lato, system-ui, sans-serif);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text, #2c2a26);
}

.auth-modal__header p {
  margin: 0;
  color: var(--text-muted, #5c574e);
  font-size: 0.95rem;
}

.auth-modal__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(44, 42, 38, 0.1));
  background: var(--bg-soft, #f0ebe1);
  color: var(--text, #2c2a26);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal__close:hover {
  background: var(--bg-sage-wash, #e8ebe0);
  border-color: var(--primary, #6e7f57);
}

.auth-modal__panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.auth-modal .auth-panel {
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--bg, #f8f5ef);
  border: 1px solid var(--border, rgba(44, 42, 38, 0.1));
  border-radius: var(--radius, 12px);
  margin-top: 0;
  text-align: left;
}

.auth-modal .auth-panel h3 {
  font-family: var(--font-display, Lato, system-ui, sans-serif);
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  color: var(--text, #2c2a26);
}

.auth-modal .auth-panel .live-form-hint {
  margin-bottom: 1rem;
  color: var(--text-muted, #5c574e);
  font-size: 0.95rem;
}

.auth-modal .live-form {
  text-align: left;
}

.auth-modal .live-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted, #5c574e);
  margin-bottom: 0.85rem;
}

.auth-modal .live-form input,
.auth-modal .live-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(44, 42, 38, 0.1));
  background: var(--white, #f7f1e4);
  font-family: var(--font-body, Lato, system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text, #2c2a26);
  box-sizing: border-box;
}

.auth-modal .live-form input:focus,
.auth-modal .live-form textarea:focus {
  outline: 2px solid var(--primary, #6e7f57);
  outline-offset: 1px;
}

.auth-modal .live-form .auth-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.auth-modal .live-form .auth-check input {
  width: auto;
  margin: 0;
}

.auth-modal .auth-forgot-wrap {
  margin: -0.25rem 0 0.85rem;
  text-align: right;
}

.auth-modal .auth-forgot-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold, #b99a5b);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-modal .auth-forgot-link:hover,
.auth-modal .auth-forgot-link:focus-visible {
  color: var(--primary-dark, #3b185f);
}

.auth-modal .auth-panel--closed {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  color: var(--text-muted, #5c574e);
}

.auth-modal .hp-field {
  position: absolute;
  left: -10000px;
}

.auth-modal .form-status {
  min-height: 1.4em;
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted, #5c574e);
}

.auth-modal .form-status.is-ok {
  color: var(--primary-dark, #5a6946);
}

.auth-modal .form-status.is-err {
  color: #8b3a3a;
}

.auth-modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.auth-modal .btn--primary {
  background: var(--primary, #6e7f57);
  color: #fff;
}

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

.mpfy-pw-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.auth-modal .live-form .mpfy-pw-wrap input,
.mpfy-pw-wrap input {
  width: 100%;
  margin-top: 0;
  padding-right: 2.5rem;
  box-sizing: border-box;
}

.mpfy-pw-toggle {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold, #b99a5b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  line-height: 0;
}

.mpfy-pw-toggle:hover,
.mpfy-pw-toggle:focus-visible {
  color: var(--primary-dark, #3b185f);
  outline: 2px solid var(--gold, #b99a5b);
  outline-offset: 1px;
}

.mpfy-pw-wrap input::-ms-reveal,
.mpfy-pw-wrap input::-ms-clear {
  display: none;
}

.mpfy-pw-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.mpfy-pw-toggle__strike {
  opacity: 0;
}

.mpfy-pw-toggle[aria-pressed="true"] .mpfy-pw-toggle__strike {
  opacity: 1;
}

@media (max-width: 720px) {
  .auth-modal__panels {
    grid-template-columns: 1fr;
  }

  .auth-modal__dialog {
    max-height: 94vh;
    padding: 1.15rem;
  }
}
