/* gm8-devapp - auth pages (login, logout). Shared so the two never drift.
   Tokens come from /styles.css; nothing here redefines a colour. */

.auth-body {
  min-height: 100dvh; display: grid; place-items: center; padding: var(--space-4);
  background:
    radial-gradient(1100px 520px at 50% -12%, color-mix(in srgb, var(--cyan) 7%, transparent), transparent 70%),
    var(--void);
}
.auth-shell { width: 100%; max-width: 404px; display: flex; flex-direction: column; gap: var(--space-3); }

.auth-brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--space-4); }
.auth-brand img { width: 30px; height: 30px; display: block; }
.auth-word { display: inline-flex; align-items: baseline; gap: 5px; font-weight: 700; letter-spacing: -.01em; font-size: 17px; color: var(--ink); }
.auth-word span { color: var(--imprint); font-weight: 600; }
.auth-dev {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  color: var(--imprint); border: 1px solid var(--hairline); border-radius: 4px; padding: 3px 7px;
}

.auth-card {
  background: var(--deck); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: var(--space-5) var(--space-4); box-shadow: 0 24px 64px var(--shadow);
}
.auth-card h1 { font-size: var(--text-lg); line-height: 1.15; letter-spacing: -.015em; }
.auth-sub { color: var(--ink-muted); font-size: var(--text-sm); margin-top: 6px; }
.auth-sub .auth-who { color: var(--ink); font-weight: 600; }

.auth-form { margin-top: var(--space-5); }
.auth-form .field { margin-bottom: var(--space-3); }
.auth-form .field input { padding-right: 68px; }

.pw-wrap { position: relative; display: block; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--imprint); cursor: pointer;
  font: 600 12px/1 "gm8Sans", "Helvetica Neue", Helvetica, sans-serif; letter-spacing: .01em;
  padding: 8px; border-radius: 5px;
}
.pw-toggle:hover { color: var(--cyan); }
.pw-toggle:focus-visible { outline: 2px solid var(--cyan-soft); outline-offset: 1px; }

.auth-error {
  min-height: 20px; margin: 2px 0 12px; font-size: var(--text-xs); color: var(--amber);
  line-height: 1.35;
}
.auth-error.ok { color: var(--cyan); }

.auth-submit { width: 100%; }
.auth-hint { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--imprint); }
.auth-stack > * + * { margin-top: 10px; }

.auth-foot {
  /* A flat bar bound to the card, not a line floating in the background:
     same surface, same radius, its own hairline. */
  display: flex; align-items: center; gap: 8px; padding: 10px var(--space-4);
  background: var(--deck); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: 0 8px 24px var(--shadow);
  font-size: 12px; color: var(--imprint); flex-wrap: wrap;
}
.auth-foot .dot { opacity: .5; }
.auth-foot a { color: var(--imprint); text-decoration: none; border-bottom: 1px solid transparent; }
.auth-foot a:hover { color: var(--cyan); border-bottom-color: var(--hairline); }

@media (prefers-reduced-motion: no-preference) {
  .auth-card { transition: box-shadow .2s ease; }
  .auth-card:focus-within { box-shadow: 0 24px 64px var(--shadow), 0 0 0 1px color-mix(in srgb, var(--cyan) 22%, transparent); }
}

/* Inline text actions (resend, recovery). NOT .pw-toggle: that one is absolutely
   positioned inside the password field and would fly out of the card here. */
/* A text link, not a button: no box, no fill. It still needs a real target size
   (24px) and a quiet but visible underline, or it reads as plain text. */
.auth-link {
  background: none; border: 0; margin: -6px 0; padding: 6px 2px;
  display: inline-flex; align-items: center; min-height: 24px;
  color: var(--ink-muted); cursor: pointer;
  font: 600 13px/1.2 "gm8Sans", "Helvetica Neue", Helvetica, sans-serif;
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; text-decoration-color: var(--cyan-soft);
}
.auth-link:hover { color: var(--cyan); text-decoration-color: currentColor; }
.auth-link:focus-visible { outline: 2px solid var(--cyan-soft); outline-offset: 2px; border-radius: 3px; }
.auth-link[disabled] { opacity: .55; cursor: default; }

/* The two text actions under the code field: one centred row, the dot as separator. */
#code-card .auth-hint {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin-top: var(--space-3); min-height: 24px;
}
#code-card .auth-hint .dot { opacity: .5; line-height: 1; }

/* Channel switch: a segmented control, not two buttons. One truth: the server
   says which channel the current challenge uses; the UI only reflects it. */
.auth-switch {
  display: flex; gap: 4px; margin-top: var(--space-4); padding: 3px;
  background: var(--deck-2); border: 1px solid var(--hairline); border-radius: 9px;
}
.auth-switch__btn {
  flex: 1 1 0; min-height: 32px; padding: 8px 10px; border: 0; border-radius: 7px; background: none;
  color: var(--imprint); cursor: pointer;
  font: 600 12px/1 "gm8Sans", "Helvetica Neue", Helvetica, sans-serif; letter-spacing: .01em;
}
.auth-switch__btn:hover { color: var(--cyan); }
.auth-switch__btn[aria-pressed="true"] {
  background: var(--raised); color: var(--ink);
  /* Inset ring instead of a hard edge: the segment keeps its radius inside the track. */
  box-shadow: inset 0 0 0 1px var(--hairline), 0 1px 3px var(--shadow);
}
.auth-switch__btn:focus-visible { outline: 2px solid var(--cyan-soft); outline-offset: 1px; }
.auth-switch__btn[disabled] { opacity: .55; cursor: default; }
