/* Auth modal, for the marketing page.
 *
 * Every rule is scoped under .auth-scrim (or .acct in the nav). This file loads
 * alongside index.html's own stylesheet, so a bare `body` or `input` selector
 * here would silently restyle the whole marketing site — which is exactly what
 * would have happened had the standalone auth page CSS been reused.
 *
 * Colours come from index.html's :root tokens; only the two states it lacks are
 * defined here. */

.auth-scrim {
  --auth-red: #d70015;
  --auth-green: #248a3d;
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  opacity: 0;
  transition: opacity .22s ease;
  font-family: var(--font);
}
.auth-scrim.open { opacity: 1; }
.auth-scrim[hidden] { display: none; }

.auth-scrim .auth-modal {
  width: 100%; max-width: 420px;
  padding: 32px 34px 26px;
  background: var(--white, #fff);
  color: var(--ink, #1d1d1f);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
  transform: translateY(10px) scale(.985);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  text-align: left;
}
.auth-scrim.open .auth-modal { transform: none; }

.auth-scrim .auth-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.auth-scrim h2 {
  margin: 0 0 5px;
  font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15;
  color: var(--ink, #1d1d1f);
}
.auth-scrim .auth-sub {
  margin: 0 0 24px; color: var(--ink-2, #6e6e73); font-size: 15px; line-height: 1.45;
}
.auth-scrim .auth-close {
  flex-shrink: 0; width: 32px; height: 32px; margin: -3px -6px 0 0;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: transparent; color: var(--ink-2, #6e6e73);
  font-size: 20px; line-height: 1; cursor: pointer;
  transition: background .15s ease;
}
.auth-scrim .auth-close:hover { background: var(--paper, #f5f5f7); }

.auth-scrim .auth-field { margin-bottom: 16px; }
.auth-scrim label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink-2, #6e6e73);
}
.auth-scrim .auth-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 6px;
}
.auth-scrim .auth-row label { margin-bottom: 0; }

.auth-scrim input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--line, #d2d2d7); border-radius: 11px;
  background: var(--white, #fff); color: var(--ink, #1d1d1f);
  font-family: inherit; font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-scrim input:hover { border-color: #b8b8bd; }
.auth-scrim input:focus {
  outline: none; border-color: var(--blue, #0071e3);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .14);
}
.auth-scrim input[aria-invalid="true"] { border-color: var(--auth-red); }

.auth-scrim .pw-wrap { position: relative; }
.auth-scrim .pw-wrap input { padding-right: 68px; }
.auth-scrim .pw-toggle {
  position: absolute; top: 0; right: 6px; height: 46px; padding: 0 9px;
  border: none; background: transparent;
  color: var(--blue-link, #0066cc); font-family: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.auth-scrim .pw-toggle:hover { text-decoration: underline; }

.auth-scrim .check { margin: 7px 0 0; font-size: 13px; color: var(--ink-3, #86868b); }
.auth-scrim .check.bad { color: var(--auth-red); }
.auth-scrim .check.good { color: var(--auth-green); }

.auth-scrim .auth-submit {
  width: 100%; height: 48px; margin-top: 8px;
  border: none; border-radius: 999px;
  background: var(--blue, #0071e3); color: #fff;
  font-family: inherit; font-size: 17px; font-weight: 500; cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.auth-scrim .auth-submit:hover:not(:disabled) { background: var(--blue-hover, #0077ed); }
.auth-scrim .auth-submit:disabled { opacity: .5; cursor: default; }

.auth-scrim .auth-alt {
  margin: 20px 0 0; text-align: center;
  color: var(--ink-2, #6e6e73); font-size: 15px;
}
.auth-scrim .auth-alt button {
  border: none; background: transparent; padding: 0;
  color: var(--blue-link, #0066cc); font-family: inherit; font-size: 15px;
  cursor: pointer;
}
.auth-scrim .auth-alt button:hover { text-decoration: underline; }
.auth-scrim .link-btn {
  border: none; background: transparent; padding: 0;
  color: var(--blue-link, #0066cc); font-family: inherit; font-size: 13px;
  cursor: pointer;
}
.auth-scrim .link-btn:hover { text-decoration: underline; }

.auth-scrim .auth-msg {
  margin: 0 0 18px; padding: 12px 14px; border-radius: 11px;
  font-size: 15px; line-height: 1.45;
}
.auth-scrim .auth-msg.error { background: #fff1f0; color: var(--auth-red); }
.auth-scrim .auth-msg.ok { background: #ebf7ee; color: var(--auth-green); }
.auth-scrim .auth-msg[hidden] { display: none; }

.auth-scrim .auth-done { text-align: center; padding: 6px 0 4px; }
.auth-scrim .auth-done .tick {
  width: 52px; height: 52px; margin: 0 auto 16px;
  display: grid; place-items: center; border-radius: 50%;
  background: #ebf7ee; color: var(--auth-green); font-size: 26px;
}

/* Nav chip once signed in.
   Inherits the nav's own 12px sizing rather than setting its own — the account
   link must sit at the same weight as Features and Pricing beside it, not shout
   over them. */
.nav-links > a.acct {
  display: inline-flex; align-items: center;
  /* Avatar only. An email address in a nav truncates to nonsense and shoves the
     rest of the bar around; the address lives in the tooltip and on the account
     page instead. */
  opacity: 1;
}
.nav-links > a.acct .avatar {
  flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue, #0071e3); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1;
  /* The nav dims its links to .8; the avatar needs to stay legible. */
  opacity: 1;
}

@media (max-width: 480px) {
  .auth-scrim .auth-modal { padding: 26px 22px 20px; border-radius: 18px; }
  .auth-scrim h2 { font-size: 23px; }
}

@media (prefers-color-scheme: dark) {
  .auth-scrim .auth-modal { background: #1c1c1e; color: #f5f5f7; }
  .auth-scrim h2 { color: #f5f5f7; }
  .auth-scrim input { background: #2c2c2e; border-color: #38383a; color: #f5f5f7; }
  .auth-scrim .auth-close:hover { background: #2c2c2e; }
  .auth-scrim .auth-msg.error { background: rgba(255, 105, 97, .14); --auth-red: #ff6961; }
  .auth-scrim .auth-msg.ok { background: rgba(48, 209, 88, .14); --auth-green: #30d158; }
  .auth-scrim .auth-done .tick { background: rgba(48, 209, 88, .16); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-scrim, .auth-scrim .auth-modal { transition: none; }
}
