/* Sign-in page, after DESIGN.md: the fuller gradient band and one centred card.
   Loads after portal.css and reuses its tokens, inputs and buttons. */

[hidden] { display: none !important; }

body.signin {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0px, rgba(255, 255, 255, 0.6) 280px, #ffffff 560px),
    linear-gradient(100deg, #f5e9d4 0%, #ffcaa6 22%, #dcd1ff 46%, #9c94ff 68%, #f4a3c3 100%);
  background-size: 100% 560px;
}

.signin-main {
  flex: 1;
  width: 100%;
  max-width: 448px;
  margin: 0 auto;
  padding: 64px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px));
  display: grid;
  gap: 22px;
  align-content: start;
}
.signin-brand { text-align: center; font-weight: 600; font-size: 19px; letter-spacing: -0.2px; color: var(--ink); }
.signin-brand span { color: var(--ink-2); font-weight: 400; }
.signin-foot { text-align: center; font-size: 13px; color: var(--ink-2); }

.signin-card { position: relative; overflow: hidden; padding: 32px; box-shadow: var(--shadow-2); }
.signin-card section { display: grid; gap: 18px; }
.signin-card h1 { font-size: 30px; letter-spacing: -0.6px; }
.signin-card h1 + .lead { margin-top: -10px; color: var(--ink-mute); font-size: 15px; }
.signin-card .stack { max-width: none; gap: 16px; }
.signin-card form button[type=submit], .signin-card section > .button, .signin-card section > button { width: 100%; }
.signin-card .actions { display: grid; gap: 10px; }
.signin-card .actions > * { width: 100%; }
.aside { text-align: center; font-size: 14px; color: var(--ink-mute); }

button.link, button.link:hover, button.link:active {
  display: inline; min-height: 0; padding: 0; border: 0; background: none;
  color: var(--primary); font-size: inherit; text-decoration: none;
}
button.link:hover { text-decoration: underline; }

/* thin indeterminate bar along the card's top edge */
.progress { position: absolute; inset: 0 0 auto 0; height: 3px; overflow: hidden; background: #e5e4ff; }
.progress span { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--primary); animation: progress 1.1s ease-in-out infinite; }
@keyframes progress { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress span { animation: none; left: 0; width: 100%; } }

/* one-time codes */
input.otp { font-size: 24px; letter-spacing: 0.32em; text-align: center; font-feature-settings: "tnum"; padding-left: calc(12px + 0.32em); }

/* authenticator set-up */
.steps { margin: 0; padding-left: 22px; display: grid; gap: 14px; color: var(--ink-2); font-size: 15px; }
.steps li::marker { color: var(--primary); font-weight: 600; }
.steps .hint { display: block; margin-top: 4px; }
.qr { width: 176px; margin: 12px 0 10px; padding: 6px; background: #ffffff; border: 1px solid var(--hairline); border-radius: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.qr path { fill: var(--ink); }
.setup-key {
  display: block; margin-top: 6px; padding: 8px 10px;
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; color: var(--ink);
  background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: 6px;
  user-select: all; overflow-wrap: anywhere;
}

/* on a phone the QR code is on the same screen as the app, so offer the otpauth:// link instead */
.otp-link { display: none; margin-top: 10px; width: 100%; }
@media (pointer: coarse) { .otp-link { display: inline-flex; } }

/* password requirements, ticked off as they are met */
.reqs { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 13px; color: var(--ink-mute); }
.reqs li::before { content: "○"; display: inline-block; width: 18px; }
.reqs li.met { color: var(--done-ink); }
.reqs li.met::before { content: "✓"; }

@media (max-width: 480px) {
  .signin-main { padding-top: 36px; }
  .signin-card { padding: 24px 20px; }
  .signin-card h1 { font-size: 26px; }
}
