/* Token gate — the first screen on an unauthenticated device.
   Deliberately plain: it renders before Alpine boots and must not depend on
   any app state, so it uses tokens.css variables only. */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-gate-card {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
}

.auth-gate-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: inherit;
}

.auth-gate-hint {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  opacity: 0.7;
}

/* Present for password managers, never shown. */
.auth-gate-username {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.auth-gate-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 18px;
  padding: 12px 14px;
  /* max(16px, …) keeps iOS from zooming the viewport on focus. */
  font-size: max(16px, 1rem);
  color: inherit;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: none;
}

.auth-gate-input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

.auth-gate-error {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #d64545;
}

.auth-gate-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  padding: 12px;
  font-size: max(16px, 1rem);
  font-weight: 650;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: filter 160ms ease;
}

.auth-gate-submit:hover:not(:disabled) {
  filter: brightness(1.08);
}

.auth-gate-submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

.auth-gate-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Offline banner — pinned to the bottom so it never covers the header, and
   above the dock so it can't be missed. */
.offline-banner {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 460px);
  padding: 10px 16px;
  font-size: 13.5px;
  line-height: 1.35;
  color: #fff;
  background: #8a5a00;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.offline-banner i {
  flex: none;
  font-size: 16px;
}
