/* ════════════════════════════════════════════════════════════════════════
   AUTH SECTION
   ════════════════════════════════════════════════════════════════════════ */
.auth-section {
  min-height: 100vh;
  display: block;
  padding: 0;
  background: #edf1f5;
}

:root[data-theme='dark'] .auth-section {
  background: #111622;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.auth-topbar {
  height: 56px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-topbar__left,
.auth-topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-logo-slot {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.auth-logo-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-topbar-btn {
  height: 34px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--color-border-strong);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  padding: 0 12px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.auth-topbar-btn--icon {
  width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-topbar-btn--secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.auth-topbar-btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.auth-topbar-btn--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* ── Auth card ─────────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 500px;
  margin: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 34px 38px 30px;
  box-shadow: var(--shadow-lg);
}

.auth-card--register {
  max-width: 560px;
  border-color: var(--color-accent-ring);
  box-shadow: 0 14px 34px -20px rgba(210, 0, 255, 0.45), var(--shadow-lg);
}

/* ── Auth form ─────────────────────────────────────────────────────────── */
.auth-form {
  margin: 0;
  animation: auth-fade-in var(--transition-base) ease-out;
}

.auth-form--hidden {
  display: none;
}

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

.auth-view-head {
  margin-bottom: 22px;
}

.auth-view-title {
  font-size: 2.1rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  margin-bottom: 8px;
  font-weight: 650;
}

.auth-view-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
}

.btn--auth {
  height: 44px;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-switch {
  margin-top: 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.auth-switch--left {
  text-align: left;
}

.auth-switch--muted {
  color: var(--color-text-tertiary);
}

.auth-inline-action {
  margin: -2px 0 12px;
  text-align: right;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.auth-register-note {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--color-surface-muted);
  display: grid;
  gap: 4px;
  margin-top: 2px;
  margin-bottom: 12px;
}

.auth-register-note strong {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--color-primary);
}

.auth-register-note span {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.auth-msg {
  margin-top: 12px;
  min-height: 20px;
  font-size: 0.84rem;
  color: var(--color-error);
  text-align: center;
}

.auth-msg:empty {
  display: none;
}

.auth-msg.is-success {
  color: var(--color-success);
}

.auth-form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.auth-form-actions .btn {
  flex: 1;
}

.password-reset-code-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.password-reset-code-input {
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
}

.password-reset-code-input.is-error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-error) 14%, transparent);
}

.password-reset-resend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.password-reset-resend-row .link[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

.password-reset-resend-timer {
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  .auth-form-actions {
    flex-direction: column;
  }

  .password-reset-code-grid {
    gap: 8px;
  }

  .password-reset-code-input {
    height: 50px;
    font-size: 1.25rem;
  }
}
