/* ============================================================
   auth.css — login screen (shown until a session exists) and
   the topbar session controls (user chip + sign out)
   ============================================================ */

/* ---- Full-screen takeover ---- */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-0);
}

/* ---- Cinematic poster-wall backdrop ---- */
.auth-tiles {
  position: absolute;
  inset: -10%;
  background-image:
    repeating-linear-gradient(90deg, rgba(38, 38, 54, 0.92) 0 128px, rgba(7, 7, 11, 0) 128px 174px),
    repeating-linear-gradient(0deg, rgba(38, 38, 54, 0.92) 0 206px, rgba(7, 7, 11, 0) 206px 262px),
    repeating-linear-gradient(90deg, rgba(242, 193, 78, 0.05) 0 128px, rgba(7, 7, 11, 0) 128px 174px);
  filter: blur(2px) saturate(0.8);
  opacity: 0.85;
  animation: authDrift 90s linear infinite alternate;
}
@keyframes authDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-4%, -3%, 0) scale(1.07); }
}
.auth-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 520px at 50% 40%, rgba(7, 7, 11, 0.55), transparent 62%),
    linear-gradient(rgba(7, 7, 11, 0.86), rgba(7, 7, 11, 0.9));
}

/* ---- Card ---- */
.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 36px 32px 30px;
  border-radius: var(--radius-xl);
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg), 0 0 90px rgba(0, 0, 0, 0.45);
  animation: spotlightIn 0.6s var(--ease) both;
}
.auth-card.is-error {
  animation: authShake 0.45s ease;
}
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #ff8a3d));
  color: var(--on-accent);
  box-shadow: 0 10px 28px var(--accent-glow);
}
.auth-brand-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-title {
  font-size: 26px;
  text-align: center;
}
.auth-sub {
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
  margin: 6px 0 8px;
}

.auth-label {
  display: block;
  margin: 16px 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

/* ---- Fields with leading icons + password eye ---- */
.auth-field {
  position: relative;
}
.auth-field > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  transition: color 0.2s ease;
}
.auth-field:focus-within > svg {
  color: var(--accent);
}
.auth-field .field {
  padding-left: 42px;
  padding-right: 46px;
}
.auth-eye {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.auth-eye:hover {
  color: var(--text-1);
  background: var(--bg-3);
}
.auth-eye .eye-off { display: none; }
.auth-eye.is-visible .eye-on { display: none; }
.auth-eye.is-visible .eye-off { display: block; }

/* ---- Error + hint boxes ---- */
.auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 2px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  border: 1px solid rgba(255, 97, 97, 0.35);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  animation: riseIn 0.3s var(--ease) both;
}
.auth-hint {
  margin: 14px 0 2px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px dashed var(--accent-border);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.auth-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--accent);
}

/* ---- Submit ---- */
.auth-submit {
  width: 100%;
  margin-top: 22px;
  padding: 14px 20px;
  font-size: 15px;
}
.auth-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--on-accent);
  border-top-color: transparent;
  animation: authSpin 0.7s linear infinite;
}
@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* ---- Topbar: user chip + sign out ---- */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 13px 4px 5px;
  border-radius: 999px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.user-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .auth-card {
    padding: 30px 22px 26px;
  }
}
