/* Sign-in modal ------------------------------------------------------------
   Shown to logged-out visitors who click a login link on desktop, so a gated
   article does not throw them onto a separate page and lose their place.
   Narrow viewports skip the modal entirely and follow the link (see
   login-modal.js) -- a fixed overlay competes badly with a phone keyboard. */
.drlm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(3px);
}
.drlm-overlay.is-open { display: flex; }

.drlm-card {
  width: min(400px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  padding: 28px 26px 24px;
  position: relative;
  animation: drlm-in 160ms cubic-bezier(.16, 1, .3, 1);
}
@keyframes drlm-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .drlm-card { animation: none; }
}

.drlm-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.drlm-close:hover  { background: var(--bg-card-h); color: var(--text-1); }
.drlm-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.drlm-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text-1);
}
.drlm-sub {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.drlm-field { margin-bottom: 13px; }
.drlm-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.drlm-field input[type="text"],
.drlm-field input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text-1);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 150ms, box-shadow 150ms;
}
.drlm-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

.drlm-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 18px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.drlm-remember input { accent-color: var(--brand); cursor: pointer; }

.drlm-submit {
  width: 100%;
  padding: 11px 16px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms, transform 120ms;
}
.drlm-submit:hover  { background: var(--brand-dark); }
.drlm-submit:active { transform: translateY(1px); }
.drlm-submit:focus-visible { outline: 2px solid var(--text-1); outline-offset: 2px; }

.drlm-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  text-align: center;
}
.drlm-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.drlm-foot a:hover { text-decoration: underline; }
.drlm-foot .drlm-lost { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.drlm-foot .drlm-lost:hover { color: var(--text-2); }
