/* ==========================================================================
   Sign in, registration and password reset.

   Tokens, buttons and field styling come from main/css/theme.css; this file
   is only the shell around them, so the auth screens read as the same product
   as the landing page.
   ========================================================================== */

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(1.5rem, 5vw, 3.5rem);
  min-width: 0; /* a grid item otherwise floors at its content's min-content width */
}

/* the column that holds the messages and the card; a definite width here keeps
   the card centred, since intrinsic sizing inflates a shrink-to-fit wrapper */
.auth-panel {
  width: 452px;
  max-width: 100%;
  min-width: 0; /* flex items otherwise floor at their min-content width */
}

.auth-card {
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.35rem);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: auth-rise 0.7s var(--ease) both;
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.auth-card h1 {
  font-size: clamp(1.5rem, 3.4vw, 1.9rem);
  letter-spacing: -0.03em;
}

.auth-note {
  margin-top: 0.65rem;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.auth-form {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.6rem;
}

.auth-form .btn {
  margin-top: 0.35rem;
}

/* the target-range band, reused as a quiet divider above the secondary links */
.auth-links {
  margin-top: 1.6rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.auth-links a {
  color: var(--accent-strong);
}

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

.messages {
  width: 100%;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.message {
  padding: 0.7rem 0.95rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.9rem;
}

.message.error {
  color: var(--danger);
  border-color: var(--danger);
}

.message.success {
  color: var(--range);
  border-color: var(--range);
}

.auth-footer {
  padding-block: 1.75rem;
  font-size: 0.82rem;
  color: var(--ink-3);
}

.auth-footer p {
  max-width: 62ch;
}

/* ----------------------------- warm overrides ------------------------------
   The auth screens share the landing page's paper-logbook world (warm.css):
   the page ground is the diary's sage cloth cover, and the card is a page of
   the diary laid on it. The authenticated app keeps the teal theme. */

/* The topbar sits on the cover, so it borrows cover colours for the shared
   theme switch — scoped custom properties, as on the landing page. */
.topbar {
  --accent: var(--cloth-ink);
  --accent-ink: var(--cloth-2);
  --paper-2: rgba(0, 0, 0, 0.18);
  --line-soft: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.26);
  --ink-3: var(--cloth-ink-2);
  color: var(--cloth-ink);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0;
}


.topbar :focus-visible {
  outline-color: var(--cloth-ink);
}

.auth-card {
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 3px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.auth-card .btn {
  font-weight: 700;
}

.auth-card :focus-visible {
  outline-color: var(--biro);
}

/* entries typed into the diary page read in biro */
.auth-card .field input,
.auth-card .field select,
.auth-card .field textarea {
  background-color: var(--surface);
  caret-color: var(--biro);
}

.auth-card .field input:focus,
.auth-card .field select:focus,
.auth-card .field textarea:focus {
  border-color: var(--biro);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--biro) 18%, transparent);
}

.messages .message {
  color: var(--ink);
  background: var(--paper);
}

.auth-footer {
  color: var(--cloth-ink-2);
}
