/* Auth screens. Reuses the tokens in styles.css so sign-in feels like the
   same desk as the studio: paper ground, hard rules, no rounded corners. */

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-shell {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
}

.auth-card {
  display: grid;
  gap: 14px;
  padding: 30px 28px 26px;
  border: 1px solid var(--ink);
  background: var(--paper-warm);
  box-shadow: var(--shadow-offset);
}

.auth-eyebrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-title {
  margin: -8px 0 0;
  font-family: var(--serif);
  font-size: clamp(30px, 7vw, 42px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.auth-lede {
  margin: -4px 0 4px;
  color: var(--mute);
  font-size: 14px;
}

/* Google is a returning-user route. The group is toggled as one unit so the
   button and its divider can never leak into account creation or recovery. */

.auth-google-group {
  display: grid;
  gap: 14px;
}

.auth-google-group[hidden] { display: none; }

.auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.auth-google:hover {
  background: var(--paper-2);
  box-shadow: 3px 3px 0 var(--shadow-hard);
  transform: translate(-1px, -1px);
}

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

.auth-google[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--hairline);
}

/* Form */

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field > span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--paper-2);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.auth-field input[aria-invalid="true"] {
  border-color: var(--accent-2);
}

.auth-password {
  position: relative;
  display: block;
}

.auth-password input {
  padding-right: 64px;
  font-family: var(--sans);
  font-variant-ligatures: none;
  letter-spacing: normal;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible,
.auth-password-toggle[aria-pressed="true"] {
  color: var(--accent);
}

.auth-submit {
  min-height: 46px;
  margin-top: 2px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.15s ease;
}

.auth-submit:hover { background: var(--accent-2); }
.auth-submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.auth-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-submit.is-busy span::after {
  content: "";
  display: inline-block;
  width: 0;
  animation: authDots 1.2s steps(4, end) infinite;
}

@keyframes authDots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
}

/* Feedback */

.auth-message {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
  font-size: 13px;
  line-height: 1.5;
}

.auth-message[hidden] { display: none; }
.auth-message::before {
  content: "Attention: ";
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.auth-message[data-tone="error"]  { color: var(--accent); }
.auth-message[data-tone="notice"] { color: var(--mute); }
.auth-message[data-tone="success"] { color: #2f5d3a; }
.auth-message[data-tone="success"]::before { content: "Done: "; }
.auth-message[data-tone="notice"]::before { content: "Note: "; }

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--hairline);
}

.auth-link {
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--mute);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--hairline);
}

.auth-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.auth-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth-footnote {
  margin: 0;
  color: var(--mute);
  font-size: 12px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .auth-google,
  .auth-submit { transition: none; }
  .auth-google:hover { transform: none; }
  .auth-submit.is-busy span::after { animation: none; content: "..."; }
}

@media (max-width: 420px) {
  .auth-card { padding: 24px 20px 22px; box-shadow: 8px 8px 0 var(--ink); }
}

/* Consent notice on the sign-up screen. A visible statement rather than a
   checkbox: an unticked box blocks signup and informs nobody, while a clear
   line above the button is what actually establishes the agreement. */
.auth-consent{
  margin: 0 0 var(--s-4);
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--mute);
}
.auth-consent a{ color: var(--accent); }

/* The mark, above the title. Small: it identifies the page without competing
   with the form, which is the only thing anyone is here to use. */
.auth-logo{
  display: block;
  margin: 0 0 var(--s-4);
}

/* The auth page centres its card in the viewport, which pushed the shared
   footer into a cramped column. Give it the page width and normal rhythm. */
.auth-body{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100vh;
}
.auth-shell{
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  padding: var(--s-7) var(--s-5);
}
.auth-body .site-footer{
  margin-top: 0;
}
.auth-body .site-footer-inner{
  width: min(var(--measure), calc(100% - var(--s-6)));
}
