/* ═══════════════════════════════════════════════════════════
   WaitingMate — LOGIN / REGISTER POPUP MODAL
   Derives colors from theme.css --wm-* variables (single source).
   Mobile-first, matches the app's auth pages.
   ═══════════════════════════════════════════════════════════ */

.wm-auth-modal .modal-dialog {
  max-width: 420px;
  margin: 1.5rem auto;
}

.wm-auth-modal .modal-content {
  border: 1px solid var(--wm-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

/* ── Header ── */
.wm-auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
}

.wm-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wm-auth-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--wm-accent-soft, rgba(24, 119, 230, 0.1));
  color: var(--wm-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.wm-auth-brand-text {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--wm-text);
}

.wm-auth-brand-text span {
  color: var(--wm-accent);
}

.wm-auth-close {
  border: none;
  background: var(--wm-bg-soft);
  color: var(--wm-text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.wm-auth-close:hover {
  background: var(--wm-border);
  color: var(--wm-text);
}

/* ── Tabs ── */
.wm-auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--wm-bg-soft);
  border-radius: 12px;
  margin: 0 22px 16px;
  padding: 4px;
}

.wm-auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 9px 10px;
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--wm-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s;
}

.wm-auth-tab i {
  font-size: 13px;
}

.wm-auth-tab:hover {
  color: var(--wm-text);
}

.wm-auth-tab.active {
  background: #fff;
  color: var(--wm-accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* ── Body ── */
.wm-auth-body {
  padding: 0 22px 6px;
  max-height: 62vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.wm-auth-body::-webkit-scrollbar {
  width: 4px;
}

.wm-auth-body::-webkit-scrollbar-thumb {
  background: var(--wm-border);
  border-radius: 4px;
}

.wm-auth-panel {
  display: none;
}

.wm-auth-panel.active {
  display: block;
  animation: wmFadeUp 0.25s ease;
}

@keyframes wmFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Inline message ── */
.wm-auth-msg {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid transparent;
}

.wm-auth-msg.error {
  background: var(--wm-danger-soft, rgba(239, 68, 68, 0.1));
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--wm-danger, #dc2626);
}

.wm-auth-msg.success {
  background: var(--wm-success-soft, rgba(115, 192, 0, 0.1));
  border-color: rgba(115, 192, 0, 0.25);
  color: var(--wm-success-dark, #4d7d00);
}

.wm-auth-msg.info {
  background: var(--wm-accent-soft, rgba(24, 119, 230, 0.08));
  border-color: rgba(24, 119, 230, 0.25);
  color: var(--wm-accent);
}

/* ── Mode switch (login) ── */
.wm-mode-switch {
  display: inline-flex;
  gap: 2px;
  background: var(--wm-bg-soft);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 14px;
}

.wm-mode-btn {
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--wm-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.wm-mode-btn.active {
  background: #fff;
  color: var(--wm-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* ── Fields ── */
.wm-field {
  margin-bottom: 14px;
}

.wm-field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--wm-text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.wm-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.wm-input-wrap > i {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: var(--wm-text-muted);
  pointer-events: none;
  z-index: 2;
}

.wm-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 42px;
  background: var(--wm-bg-soft);
  border: 1.5px solid var(--wm-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wm-text);
  outline: none;
  transition: all 0.22s;
  box-sizing: border-box;
}

.wm-input-wrap input:focus {
  background: #fff;
  border-color: var(--wm-accent);
  box-shadow: 0 0 0 3px var(--wm-accent-soft, rgba(24, 119, 230, 0.12));
}

.wm-input-wrap input.error {
  border-color: var(--wm-danger, #ef4444);
  background: #fff5f5;
}

.wm-eye {
  position: absolute;
  right: 6px;
  border: none;
  background: transparent;
  color: var(--wm-text-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 2;
}

.wm-eye:hover {
  color: var(--wm-accent);
}

.wm-field-row {
  display: flex;
  gap: 10px;
}

.wm-field-row .wm-field {
  flex: 1;
  min-width: 0;
}

/* ── Submit buttons ── */
.wm-submit-btn {
  width: 100%;
  border: none;
  background: var(--wm-accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 13px 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.22s;
  box-shadow: 0 4px 14px rgba(24, 119, 230, 0.25);
}

.wm-submit-btn:hover {
  background: var(--wm-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(24, 119, 230, 0.32);
}

.wm-submit-btn:active {
  transform: translateY(0);
}

.wm-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.wm-submit-ghost {
  background: var(--wm-bg-soft);
  color: var(--wm-accent);
  box-shadow: none;
  border: 1.5px solid var(--wm-accent);
  margin-bottom: 6px;
}

.wm-submit-ghost:hover {
  background: var(--wm-accent-soft, rgba(24, 119, 230, 0.08));
  color: var(--wm-accent);
  box-shadow: none;
}

.wm-btn-spinner {
  font-size: 15px;
}

/* ── OTP section ── */
.wm-otp-section {
  margin-top: 16px;
  border-top: 1px dashed var(--wm-border);
  padding-top: 16px;
}

.wm-otp-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wm-text-secondary);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.5;
}

.wm-otp-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.wm-otp {
  width: 52px;
  height: 56px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--wm-text);
  background: var(--wm-bg-soft);
  border: 1.5px solid var(--wm-border);
  border-radius: 12px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.wm-otp:focus {
  border-color: var(--wm-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--wm-accent-soft, rgba(24, 119, 230, 0.12));
}

.wm-otp-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  color: var(--wm-text-muted);
  font-weight: 600;
}

.wm-otp-meta b {
  color: var(--wm-accent);
}

.wm-resend {
  border: none;
  background: none;
  color: var(--wm-accent);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}

.wm-resend:hover {
  color: var(--wm-accent-hover);
}

/* ── Terms ── */
.wm-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--wm-text-secondary);
  font-weight: 500;
  line-height: 1.45;
  margin: 2px 0 14px;
  cursor: pointer;
}

.wm-terms input {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: var(--wm-accent);
  flex-shrink: 0;
  cursor: pointer;
}

.wm-terms a {
  color: var(--wm-accent);
  font-weight: 700;
  text-decoration: none;
}

.wm-terms a:hover {
  text-decoration: underline;
}

/* ── Back button (register step 2) ── */
.wm-back-btn {
  width: 100%;
  margin-top: 10px;
  border: none;
  background: transparent;
  color: var(--wm-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  font-family: inherit;
}

.wm-back-btn:hover {
  color: var(--wm-text);
}

/* ── Extra links & footer ── */
.wm-auth-extra {
  text-align: right;
  margin-top: 12px;
}

.wm-link {
  color: var(--wm-accent);
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
}

.wm-link:hover {
  text-decoration: underline;
}

.wm-auth-footer {
  border-top: 1px solid var(--wm-border-light);
  padding: 14px 22px 18px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--wm-text-secondary);
}

/* ── Mobile (< 576px) ── */
@media (max-width: 575.98px) {
  .wm-auth-modal .modal-dialog {
    margin: 0.75rem auto;
    max-width: calc(100% - 24px);
  }

  .wm-auth-modal .modal-content {
    border-radius: 18px;
  }

  .wm-auth-body {
    padding: 0 16px 6px;
    max-height: 66vh;
  }

  .wm-auth-tabs {
    margin: 0 16px 14px;
  }

  .wm-auth-footer {
    padding: 12px 16px 16px;
  }

  .wm-otp {
    width: 46px;
    height: 50px;
    font-size: 1.2rem;
  }
}
