/* ===== AUTH PAGE ===== */
/* Extends the tokens and component patterns defined in style.css
   (colors, fonts, pixel borders/shadows) with the components the
   passwordless login flow needs. */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
}

.auth-back-home {
  position: absolute;
  top: 28px;
  left: 32px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 2px solid var(--yellow);
  box-shadow: 0 0 0 3px var(--bg), 6px 6px 0 var(--pink);
  padding: 40px 32px;
  position: relative;
  z-index: 2;
}

.auth-card__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-bottom: 30px;
  text-decoration: none;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-card__title {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 3vw, 20px);
  line-height: 1.4;
  color: var(--text);
  text-shadow: 3px 3px 0 var(--pink);
}

.auth-card__subtitle {
  font-family: var(--font-retro);
  font-size: 19px;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.4;
}

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

/* ---- buttons ---- */

.auth-btn-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-submit-btn .auth-btn-content {
  gap: 10px;
}

/* Author `display` rules above outrank the UA [hidden] rule at equal
   specificity, so the hidden attribute needs an explicit override here. */
.auth-btn-content[hidden],
.auth-spinner[hidden] {
  display: none;
}

.auth-submit-btn:focus-visible,
.auth-input:focus-visible,
.auth-otp-box:focus-visible,
.auth-link-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---- form fields ---- */

.auth-field {
  margin-bottom: 18px;
}

.auth-field__label {
  display: block;
  font-family: var(--font-retro);
  font-size: 17px;
  color: var(--cyan);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.auth-input {
  width: 100%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: var(--font-base);
  font-size: 16px;
  padding: 13px 14px;
  transition: border-color 0.15s ease;
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-input:focus {
  border-color: var(--cyan);
}

.auth-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-align: center;
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---- otp ---- */

.auth-otp-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
}

.auth-otp-group {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.auth-otp-box {
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  text-align: center;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 17px;
  transition: border-color 0.15s ease;
}

.auth-otp-box:focus {
  border-color: var(--cyan);
}

.auth-otp-box:disabled {
  opacity: 0.6;
}

.auth-dev-hint {
  border: 2px dashed rgba(255, 255, 255, 0.3);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-family: var(--font-retro);
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-dev-hint strong {
  color: var(--green);
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.auth-otp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  font-family: var(--font-retro);
  font-size: 16px;
}

/* ---- shared bits ---- */

.auth-back-row {
  margin-bottom: 18px;
}

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-retro);
  color: var(--cyan);
  font-size: 17px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link-btn:hover {
  color: var(--text);
}

.auth-link-btn:disabled {
  color: var(--footer-muted);
  cursor: default;
  text-decoration: none;
}

.auth-status {
  min-height: 20px;
  font-family: var(--font-retro);
  font-size: 16px;
  line-height: 1.4;
  margin-top: 16px;
}

.auth-status:empty {
  margin-top: 0;
}

.auth-status--error {
  color: var(--pink);
}

.auth-status--info {
  color: var(--cyan);
}

.auth-spinner {
  width: 12px;
  height: 12px;
  background: currentColor;
  display: inline-block;
  animation: bmrPulse 0.7s steps(2) infinite;
  flex: none;
}

.auth-footnote {
  text-align: center;
  margin-top: 26px;
  font-family: var(--font-retro);
  font-size: 15px;
  color: var(--footer-muted);
  line-height: 1.5;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 32px 22px;
    box-shadow: 0 0 0 3px var(--bg), 4px 4px 0 var(--pink);
  }
  .auth-back-home {
    top: 18px;
    left: 18px;
  }
}
