/*
 * Auth (login / signup) — flat card, light borders only, no shadows.
 * Step flow (email → code → username) is driven by js/auth.js toggling
 * `is-active` on [data-step] elements.
 */

.auth-shell {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 20px 88px;
}

/* ------------------------------------------------------------------ card */
.auth-card {
  width: 100%;
  max-width: 432px;
  padding: 36px 32px 30px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.auth-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}
.auth-subtitle {
  margin-top: 8px;
  margin-bottom: 26px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

/* ---------------------------------------------------------------- steps */
.auth-steps { position: relative; }

[data-step] { display: none; }
[data-step].is-active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Per-step header (code + username steps) */
.auth-step-icon {
  width: 52px;
  height: 52px;
  margin: 4px auto 2px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 21px;
  color: var(--unique);
  background: color-mix(in srgb, var(--unique) 12%, transparent);
}
.auth-step-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
}
.auth-step-text {
  margin: -6px 0 2px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}
.auth-step-text strong { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------- fields */
.auth-field { text-align: left; }
.auth-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.auth-input-wrap { position: relative; }
.auth-input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.15s ease;
}
.auth-input-wrap:focus-within .auth-input-icon { color: var(--unique); }

.input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--input-field);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.input.has-icon { padding-left: 42px; }
.input::placeholder { color: color-mix(in srgb, var(--text) 38%, transparent); }
.input:focus {
  border-color: var(--unique);
  background: var(--surface-raised);
}

/* ------------------------------------------------------------------ OTP */
.otp {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.otp input {
  width: 46px;
  height: 58px;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-field);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.otp input:focus {
  border-color: var(--unique);
  background: var(--surface-raised);
}
@media (max-width: 380px) {
  .otp { gap: 7px; }
  .otp input { width: 42px; height: 54px; font-size: 20px; }
}

/* -------------------------------------------------------------- buttons */
.auth-btn {
  width: 100%;
  height: 50px;
  margin-top: 2px;
  font-size: 15px;
  gap: 8px;
}
.auth-btn i { font-size: 13px; }

/* ---------------------------------------------------------- meta / link */
.auth-error {
  color: var(--danger);
  font-size: 13.5px;
  text-align: center;
  min-height: 0;
}
.auth-error:empty { display: none; }

.auth-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}
.auth-meta i { font-size: 11px; opacity: 0.8; }

.auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px auto 0;
  padding: 8px 12px;
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.auth-link:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.auth-link i { font-size: 11px; }

.auth-foot {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.auth-foot a {
  color: var(--unique);
  font-weight: 600;
  text-decoration: none;
}
.auth-foot a:hover { text-decoration: underline; }
