/* Auth gate — the cover of the Kata Archive. Same Archivo/Newsreader pairing
   and terracotta accent as the archive pages, plus a dark "cover" field this
   page alone uses to read as the threshold into the archive. */

.auth-cover {
  --cover: #14120f;
  --paper: #f7f5f0;
  --ink: #1a1815;
  --seal: #c8342a;
  --seal-dark: #9e281f;

  min-height: 100vh;
  box-sizing: border-box;
  background: var(--cover);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  font-family: 'Archivo', system-ui, sans-serif;
}

.auth-cover__glyph {
  position: absolute;
  top: 50%;
  right: -6%;
  transform: translateY(-50%);
  font: 400 clamp(220px, 42vw, 520px)/1 'Newsreader', serif;
  color: rgba(247, 245, 240, .07);
  user-select: none;
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--paper);
  color: var(--ink);
  padding: 48px 44px 40px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
  animation: auth-card-in .5s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card__eyebrow {
  display: block;
  font: 700 11px/1 'Archivo', sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--seal);
  margin-bottom: 20px;
}

.auth-card__title {
  margin: 0;
  font: 800 34px/1.05 'Archivo', sans-serif;
  letter-spacing: -.01em;
}

.auth-card__lede {
  margin: 12px 0 30px;
  font: 400 15px/1.55 'Newsreader', serif;
  color: rgba(26, 24, 21, .7);
}

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

.auth-form__label {
  font: 700 11px/1 'Archivo', sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(26, 24, 21, .5);
  margin-top: 20px;
}

.auth-form__label:first-child {
  margin-top: 0;
}

.auth-form__input {
  font: 400 16px/1.4 'Archivo', sans-serif;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(26, 24, 21, .25);
  padding: 10px 2px;
  margin-top: 8px;
}

.auth-form__input:focus {
  outline: none;
  border-bottom-color: var(--seal);
  box-shadow: 0 1px 0 0 var(--seal);
}

.auth-form__error {
  margin: 16px 0 0;
  padding-left: 11px;
  border-left: 2px solid var(--seal);
  font: 500 13px/1.5 'Archivo', sans-serif;
  color: var(--seal-dark);
}

/* Role picker — quiet stamped chips instead of a native select */
.auth-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.auth-roles__chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.auth-roles__chip span {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid rgba(26, 24, 21, .25);
  font: 700 11px/1 'Archivo', sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(26, 24, 21, .6);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.auth-roles__chip input:checked + span {
  border-color: var(--seal);
  background: rgba(200, 52, 42, .08);
  color: var(--seal-dark);
}

.auth-roles__chip input:focus-visible + span {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

/* The hanko stamp — the sign-in / create-account action */
.auth-stamp {
  display: block;
  margin: 34px auto 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  width: fit-content;
}

.auth-stamp__ring {
  position: relative;
  min-width: 160px;
  height: 52px;
  padding: 0 28px;
  border-radius: 6px;
  border: 3px solid var(--seal);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, background .15s ease;
}

.auth-stamp:hover .auth-stamp__ring {
  background: rgba(200, 52, 42, .06);
}

.auth-stamp:active .auth-stamp__ring {
  transform: scale(.92);
}

.auth-stamp:focus-visible .auth-stamp__ring {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.auth-stamp__glyph {
  font: 600 15px/1 'Archivo', sans-serif;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--seal);
  white-space: nowrap;
}

.auth-stamp__ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 8px;
  border: 2px solid var(--seal);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-cover__glyph {
    animation: auth-glyph-breathe 12s ease-in-out infinite;
  }
  .auth-stamp.is-stamping .auth-stamp__ring::after {
    animation: auth-stamp-ripple .6s ease-out forwards;
  }
}

@keyframes auth-glyph-breathe {
  0%, 100% { opacity: .07; }
  50% { opacity: .1; }
}

@keyframes auth-stamp-ripple {
  from { transform: scale(.5); opacity: .55; }
  to { transform: scale(2.6); opacity: 0; }
}

.auth-card__foot {
  margin: 28px 0 0;
  text-align: center;
  font: 400 13px/1.5 'Newsreader', serif;
  color: rgba(26, 24, 21, .6);
}

.auth-card__foot a {
  color: var(--seal-dark);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 52, 42, .4);
}

.auth-card__foot a:hover {
  border-bottom-color: var(--seal-dark);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 40px 26px 32px;
  }
  .auth-card__title {
    font-size: 28px;
  }
}
