/* The sign-in window (owner 2026-11-18, signInWindow.js): in front of the
   page, which is blurred behind it, on every page; a sheet from the bottom on
   a phone. The home page (login.html) has the same window in its markup. */

.hl-signin {
  --hl-heading: var(--text);
  --hl-line: color-mix(in srgb, var(--border) 60%, transparent);
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--hl-line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .hl-signin { --hl-heading: var(--brand-navy); }
.hl-signin[open] { animation: dt-signin-pop 180ms ease-out; }
.hl-signin::backdrop {
  background: rgba(2, 6, 23, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hl-signin-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.hl-signin h2 { margin: 0 0 6px; padding-right: 40px; font-size: 1.35rem; color: var(--hl-heading); }
.hl-signin-note { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }
.hl-oauth { display: grid; gap: 10px; }
.hl-oauth-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.hl-oauth-btn:hover { border-color: var(--accent); }
.hl-oauth-btn:disabled { opacity: 0.6; cursor: progress; }
.hl-oauth-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.hl-signin-parent { display: block; margin-top: 18px; color: var(--link); font-size: 0.9rem; text-decoration: none; }
.hl-signin-parent:hover { text-decoration: underline; }
.hl-signin-error { color: var(--bad); font-size: 0.88rem; margin: 12px 0 0; }
.hl-signin-error:empty { display: none; }

@keyframes dt-signin-pop {
  from { opacity: 0; scale: 0.97; }
  to { opacity: 1; scale: 1; }
}

/* A phone: a sheet along the bottom, above the home indicator. */
@media (max-width: 560px) {
  .hl-signin {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }
  .hl-signin[open] { animation: dt-signin-sheet 220ms ease-out; }
}

@keyframes dt-signin-sheet {
  from { translate: 0 40px; opacity: 0.4; }
  to { translate: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hl-signin[open] { animation: none; }
}
