/* ── Login/register modals — frosted glass over the current page ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: var(--modal-overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-overlay[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 34px 26px 26px 26px;
  background: var(--modal-glass-bg);
  /* A soft wash of the theme's own accent colour at the top, fading into
     the existing frosted glass — adapts to day/dusk/night automatically
     since --primary-soft is already themed per phase, no new tokens. */
  background-image: radial-gradient(130% 90% at 50% -20%, var(--primary-soft) 0%, transparent 60%);
  border: 1px solid var(--modal-glass-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  animation: fw-modal-in .22s cubic-bezier(.22, 1, .36, 1);
}
.modal-card[hidden] { display: none; }

@keyframes fw-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s ease, color .15s ease, transform .2s ease;
}
.modal-close:hover { background: var(--surface2); color: var(--ink); transform: rotate(90deg); }

/* Small brand mark at the top of the card — the modal previously jumped
   straight to the heading with nothing tying it back to the site, unlike
   the standalone login/register pages which sit under the Fiskevejr
   wordmark. */
.auth-modal-brand { display: flex; justify-content: center; }
.auth-modal-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #fff;
  background: var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 75%, black) 100%);
  box-shadow: 0 8px 20px -6px var(--primary);
}

.modal-card .auth-title,
.modal-card .auth-lead {
  text-align: center;
}
.modal-card .auth-title { margin-top: -2px; }
