/* The sign-in screen and the "sign in again" banner. Colours come from styles.css. */

/* Nothing shows until auth.js knows whether you're signed in: no flash of the dashboard. */
body.auth-pending main {
  visibility: hidden;
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 140px);
  padding: 24px 0;
}
.auth-card {
  width: min(460px, 100%);
}
.auth-card h1 {
  margin: 6px 0 10px;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.1;
}
.auth-form > label {
  display: block;
  margin-top: 20px;
}
.auth-form small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.auth-link {
  display: block;
  margin-top: 16px;
  padding: 0;
  color: var(--cyan);
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.auth-warning,
.auth-error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}
.auth-warning {
  color: var(--amber);
  border: 1px solid rgba(255, 202, 104, 0.3);
  background: rgba(255, 202, 104, 0.08);
}
.auth-error {
  color: var(--red);
  border: 1px solid rgba(255, 107, 103, 0.3);
  background: rgba(255, 107, 103, 0.08);
}

.reauth-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(620px, calc(100vw - 32px));
  padding: 14px 16px;
  color: var(--text);
  border: 1px solid rgba(255, 202, 104, 0.45);
  border-radius: 14px;
  background: #221d12;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
  font-size: 13px;
}
.reauth-banner span {
  flex: 1;
}
.reauth-banner button {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  color: #1a1406;
  border: 0;
  border-radius: 10px;
  background: var(--amber);
  font-weight: 800;
  cursor: pointer;
}
.reauth-banner button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Same banner, offering the home screen instead of a sign-in: an invitation, not a warning. */
.homescreen-banner {
  border-color: var(--line);
  background: var(--panel-2);
}
.homescreen-banner button.ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: transparent;
  font-weight: 600;
}
/* On a phone the sentence needs the whole width, with the two answers under it. */
@media (max-width: 520px) {
  .homescreen-banner { flex-wrap: wrap; gap: 10px; }
  .homescreen-banner span { flex: 1 1 100%; }
  .homescreen-banner button { flex: 1 1 0; }
}

.recovery-code {
  margin: 22px 0 6px;
  padding: 18px 12px;
  color: var(--text);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #0c1117;
  font: 700 clamp(18px, 4.6vw, 24px) / 1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-align: center;
  user-select: all;
}

.auth-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.device-dialog {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #121820;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}
.device-dialog::backdrop {
  background: rgba(4, 6, 9, 0.7);
}
.device-dialog-body {
  padding: 24px;
}
.device-dialog h2 {
  margin: 0 0 10px;
  font-size: 21px;
}
.device-dialog ol {
  margin: 0 0 14px;
  padding-left: 20px;
  color: #b3bdc6;
  font-size: 13px;
  line-height: 1.6;
}
.device-qr {
  width: min(240px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}
.device-qr:empty {
  background: rgba(255, 255, 255, 0.04);
}
.device-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.device-dialog #deviceLink {
  font-size: 12px;
}
.device-recovery {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.device-recovery > p:first-child {
  margin: 0 0 10px;
  color: #b3bdc6;
  font-size: 13px;
  line-height: 1.5;
}
.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}
