/* auth-modal.css — the sign-in overlay (audit S1).
 *
 * Shown over whatever the visitor was already looking at, so the dashboard
 * behind it stays legible through the dim. Everything here is a token: the card
 * has to sit in the same surface language as the rest of the app, and the
 * light/dark split for elevation (shadow vs lifted edge) is already solved in
 * tokens.css -- restating it in hex here is how the two drift apart.
 */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* Dim, not hide. The point of the overlay is that the page you came from is
   * still there -- a solid backdrop would be the full-screen swap again with
   * extra steps. */
  background: rgba(6, 8, 12, .58);
  backdrop-filter: blur(2px);
  animation: authFade .12s ease-out;
}
.auth-modal[hidden] { display: none; }

@keyframes authFade { from { opacity: 0 } to { opacity: 1 } }

.auth-modal-card {
  position: relative;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px 26px 22px;
  background: var(--bg1);
  border-radius: calc(var(--radius) * 1.75);
  box-shadow: var(--sh-modal);
  animation: authRise .14s ease-out;
}

@keyframes authRise {
  from { opacity: 0; transform: translateY(6px) }
  to   { opacity: 1; transform: none }
}

/* Dark: elevation reads as a lit edge, since a shadow on near-black is invisible.
 * Light keeps the shadow alone. Same rule the rest of the app follows. */
:root:not(.light) .auth-modal-card {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), var(--sh-modal);
}

/* Brand row. The mark's colours live in base.css but scoped to .nav-logo-mark,
 * so they are restated here for this container -- same two-line light/dark split,
 * not a new palette. */
.auth-modal-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}
.auth-modal-brand svg { width: 22px; height: 22px; }
.auth-modal-brand b {
  font-size: var(--fs-sm);
  font-weight: 650;
  letter-spacing: .2px;
}
.auth-modal-brand .mk-bond { stroke: #33436b; }
.auth-modal-brand .mk-node { fill:   #5b93ff; }
.auth-modal-brand .mk-core { fill:   #eaf0fe; }
body.light .auth-modal-brand .mk-bond { stroke: #b9cef7; }
body.light .auth-modal-brand .mk-node { fill:   #2e6bf6; }
body.light .auth-modal-brand .mk-core { fill:   #0f1729; }

.auth-modal-card h2 {
  margin: 0 0 4px;
  /* fs-md, not fs-lg: the product name is long enough to wrap in a 360px card,
   * and a wrapped 18px heading reads as a mistake. */
  font-size: var(--fs-md);
  font-weight: 650;
  line-height: 1.3;
}
.auth-modal-sub {
  margin: 0 0 18px;
  font-size: var(--fs-sm);
  color: var(--t1);
}

.auth-modal-card label {
  display: block;
  margin: 14px 0 6px;
  font-size: var(--fs-caption);
  color: var(--t1);
}
.auth-modal-card label:first-of-type { margin-top: 0 }

/* Under the handle field: which spellings of a name are accepted. Sized like
   the card's footnote rather than like a label -- it is an aside, and at label
   weight it would compete with "Password" directly under it. */
.auth-modal-hint {
  margin: 6px 0 0;
  font-size: var(--fs-caption);
  color: var(--t2);
  line-height: 1.5;
}

.auth-modal-card input[type=text],
.auth-modal-card input[type=password] {
  width: 100%;
  padding: 10px 12px;
  font-size: var(--fs-md);
  color: var(--t0);
  background: var(--bg2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-modal-card input:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent);
}

.auth-modal-card button[type=submit] {
  margin-top: 18px;
  width: 100%;
  padding: 10px 12px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: #fff;
  background: var(--acc);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter .15s;
}
.auth-modal-card button[type=submit]:hover:not(:disabled) { filter: brightness(1.06) }
.auth-modal-card button[type=submit]:disabled { opacity: .6; cursor: default }

.auth-modal-err {
  margin-top: 14px;
  padding: 9px 11px;
  font-size: var(--fs-sm);
  color: var(--err);
  background: color-mix(in srgb, var(--err) 10%, transparent);
  border-radius: var(--radius);
}
.auth-modal-err[hidden] { display: none }

/* Under the submit button, above the footnote rule. Same placement as
   templates/auth/login.html -- the eye goes to the button after an attempt that
   did not work, and that is where the way out belongs. */
.auth-modal-reset {
  margin: 12px 0 0;
  font-size: var(--fs-caption);
  text-align: center;
}
.auth-modal-reset a, .auth-modal-foot a { color: var(--acc); text-decoration: none }
.auth-modal-reset a:hover, .auth-modal-foot a:hover { text-decoration: underline }

.auth-modal-foot {
  margin: 16px 0 0;
  padding-top: 13px;
  border-top: 1px solid color-mix(in srgb, var(--t2) 22%, transparent);
  font-size: var(--fs-caption);
  color: var(--t2);
  line-height: 1.6;
}

.auth-modal-x {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 2px 6px;
  font-size: 20px;
  line-height: 1;
  color: var(--t2);
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.auth-modal-x:hover { color: var(--t1); background: var(--bg2) }
