/* Auth pages (login, sign up, forgot, reset) — public, no app shell. */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-brand .brand-mark {
  width: 34px;
  height: 34px;
}

.auth-title {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.02em;
  margin: 0 0 4px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form .input {
  width: 100%;
}

.auth-form .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 11px 14px;
  font-size: 14px;
}

.auth-status {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.auth-status.neg { color: var(--red); }
.auth-status.pos { color: var(--green); }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.auth-links a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 550;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-note {
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  border: .5px solid var(--border);
  background: var(--surface-raised);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 16px;
}

.auth-note.warn {
  background: var(--amber-dim);
}

.auth-note svg {
  flex: none;
  margin-top: 2px;
  color: var(--amber);
}

.auth-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

/* The way back to the other auth page: one line, not a second call to
   action competing with the only button that matters here. */
.auth-alt {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-alt a {
  color: var(--cyan);
  font-weight: 600;
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

/* Above the security note, below the form: present but not competing with
   the one thing the page is for. */
.auth-public-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 12.5px;
}

.auth-public-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.auth-public-links a:hover { color: var(--text); }
.auth-public-links span { color: var(--text-muted); }

.auth-public-links + .auth-foot { margin-top: 12px; }

.auth-foot {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.pw-wrap {
  position: relative;
}

.pw-wrap .input {
  padding-inline-end: 62px;
}

.pw-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.pw-toggle:hover {
  color: var(--text);
  background: var(--surface-raised);
}

/* ---- split layout (register / login) ---------------------------------- */

.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--bg);
  /* The home link is positioned against this, not against the hero panel. */
  position: relative;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
  border-inline-end: .5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 48px 56px;
}

.hero-chart {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 55%;
  opacity: .5;
  pointer-events: none;
}

.hero-area { fill: url(#hero-fill); }
.hero-line { fill: none; stroke: var(--cyan); stroke-width: 2; opacity: .6; }

.hero-inner {
  position: relative;
  max-width: 420px;
}

.hero-inner .auth-brand {
  margin-bottom: 36px;
}

.hero-inner .brand-sub {
  color: var(--cyan);
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: 0;
}

.hero-title {
  font-size: 38px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 0 0 16px;
}

.hero-title span {
  color: var(--cyan);
}

.hero-text {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 28px;
}

.hero-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-benefits li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  line-height: 1.35;
}

.hb-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--cyan-dim);
  color: var(--cyan);
  display: grid;
  place-items: center;
  flex: none;
}

.hero-quote {
  margin: 40px 0 0;
  font-size: 15px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-quote span {
  font-style: normal;
  color: var(--text-muted);
}

.auth-side {
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

.auth-side .auth-card {
  max-width: 440px;
  padding: 32px;
}

.auth-title.centered,
.auth-sub.centered {
  text-align: center;
}

.auth-title.centered {
  font-size: 24px;
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap > svg {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrap .input {
  padding-inline-start: 36px;
}

.pw-meter {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.pw-meter i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border-strong);
}

.pw-meter.s1 i:nth-child(1) { background: var(--red); }
.pw-meter.s2 i:nth-child(-n+2) { background: var(--amber); }
.pw-meter.s3 i { background: var(--green); }

.pw-rules {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.pw-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pw-rules li::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex: none;
  box-sizing: border-box;
}

.pw-rules li.ok {
  color: var(--green);
}

.pw-rules li.ok::before {
  border-color: var(--green);
  background: var(--green-dim);
}

#pw-match.ok { color: var(--green); }
#pw-match.bad { color: var(--red); }

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}

.auth-row a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 550;
  white-space: nowrap;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: .5px;
  background: var(--border);
}

.btn-outline {
  width: 100%;
  justify-content: center;
  padding: 11px 14px;
  border: .5px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font-size: 14px;
  text-decoration: none;
}

.btn-outline:hover {
  background: var(--cyan-dim);
}

.auth-foot a {
  color: var(--cyan);
  text-decoration: none;
}

@media (max-width: 960px) {
  .auth-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-hero {
    display: none;
  }
}

/* ---- back to the public site ------------------------------------------ */

/* The brand is the way home. On the split pages it sits in the top corner,
   over the hero panel but not inside it: that panel is aria-hidden and is
   hidden outright below 960px, so a link living in there would be
   unreachable by keyboard and gone on a phone — on the very page where a
   visitor is most likely to want back out. */
.auth-home {
  color: inherit;
  text-decoration: none;
  border-radius: 999px;
  padding: 7px 14px 7px 9px;
  border: .5px solid transparent;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}

.auth-split > .auth-home {
  position: absolute;
  top: 22px;
  inset-inline-start: 24px;
  z-index: 2;
  margin-bottom: 0;
}

.auth-home:hover {
  background: var(--surface-raised);
  border-color: var(--border);
}

.auth-home:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* The name and the strapline stack. They are spans inside a link rather than
   the divs they were as a static block — a div inside an anchor is legal but
   these have to lay out the same, and inline spans would run them onto one
   line. */
.auth-home .brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

/* The mark leans towards the page it opens the moment the link is hovered. */
.auth-home .brand-mark {
  transition: transform .18s var(--ease);
}

.auth-home:hover .brand-mark {
  transform: translateX(-2px);
}

[dir="rtl"] .auth-home:hover .brand-mark {
  transform: translateX(2px);
}

/* The two password pages carry the brand at the top of the card, where it
   already was; there it stays in the flow and only gains the link. */
.auth-home.is-inline {
  display: inline-flex;
  margin-inline-start: -9px;
}

@media (prefers-reduced-motion: reduce) {
  .auth-home .brand-mark,
  .auth-home:hover .brand-mark {
    transition: none;
    transform: none;
  }
}

@media (max-width: 960px) {
  /* The hero is gone here and there is nothing left to float over: lifted out
     of position, the link becomes the first row of the grid and the form
     starts below it. Kept absolute it sat on top of the card's own title. */
  .auth-split > .auth-home {
    position: static;
    justify-self: start;
    align-self: start;
    margin: 14px 0 0 6px;
    padding: 6px 12px 6px 8px;
  }

  .auth-split > .auth-home .brand-sub {
    display: none;
  }
}

/* After a new password is saved the form goes and this is what is left: the
   confirmation and one clear way to sign in. */
#reset-signin {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

/* Sign-up from a portfolio invitation: the invited address, shown but not editable. */
.field.is-locked .input { opacity: .85; cursor: not-allowed; }
.auth-note[data-invite-note] { margin-block-end: 14px; }
